-
Notifications
You must be signed in to change notification settings - Fork 170
Render /list-claude-pr-status output as a markdown table #1437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+15
−7
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 PR titles containing a literal
|will corrupt the rendered markdown table. The awkprintfat line 64 interpolates the title field ($4) directly into a table cell with no escaping, so a title likeFix foo | refactor barproduces a row with extra column boundaries and a misaligned table. Easy fix:gsub(/\|/, "\\|", $4)inside the awk action before printing.Extended reasoning...
What the bug is
In Step 3 (lines 55-66), the renderer pipes the TSV through awk and emits each data row with:
The title column (
$4) is interpolated verbatim. GitHub PR titles are free-form user input coming fromgh pr list --json titleand can legitimately contain a literal|(e.g.frontend | use new API,Fix foo | refactor bar).How it manifests
For a PR titled
Fix foo | refactor bar, the emitted row is:Markdown parses pipes as column separators, so that row becomes 6 cells in a 4-column table and the row is misaligned in the rendered output.
Why existing code doesn't prevent it
The previous Step 3 was prose that delegated rendering to the assistant, which could escape pipes when constructing the table. This PR moves rendering into a deterministic bash/awk pipeline that emits raw field values. The check-breakdown column (
$3) is wrapped in backticks which incidentally tolerates pipes inside it, but the title column has no such protection.Step-by-step proof
claude/...branch with titleFix foo | refactor bar.123\tFix foo | refactor barinto/tmp/claude_pr_candidates.tsv.123\tREADY\tSUCCESS=44\tFix foo | refactor barto/tmp/claude_pr_status.tsv.-F'\t', so$4 = "Fix foo | refactor bar".printfemits| [#123](...) | READY |SUCCESS=44| Fix foo | refactor bar |.|-delimited segments and produces a misaligned 6-cell row under a 4-column header.Impact
Cosmetic / display-only. The link and information are still present and readable in raw form, and this is an informational developer slash command. Pipes in PR titles are uncommon — but not impossible — for Claude-authored PRs.
How to fix
Escape pipes in the title before printing, e.g.:
{ gsub(/\|/, "\\|", $4); printf "| [#%s](https://github.com/SemiAnalysisAI/InferenceX/pull/%s) | %s | `%s` | %s |\n", $1, $1, $2, $3, $4 }