Skip to content

fix(dispatch): strip CRLF \r from comment body before command matching - #2168

Merged
ascerra merged 1 commit into
mainfrom
fix/2137-crlf-dispatch
Jun 11, 2026
Merged

fix(dispatch): strip CRLF \r from comment body before command matching#2168
ascerra merged 1 commit into
mainfrom
fix/2137-crlf-dispatch

Conversation

@ascerra

@ascerra ascerra commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Strip \r from GitHub comment bodies in the dispatch command extraction pipeline so slash commands match correctly when the comment has multiple lines
  • Fixes all four head -1 | awk pipelines across both dispatch routers (reusable-dispatch.yml and scaffold dispatch.yml)
  • Root cause: GitHub delivers comment bodies with \r\n (CRLF) line endings; head -1 strips \n but keeps \r, so COMMAND becomes /fs-fix\r which silently fails the exact-match case statement

Evidence

What Link
Original failure (/fs-fix on PR #2136) Workflow run 27298310530
Reproduced on /fs-triage (node-api #2) Workflow run 27301834754
Issue with full analysis #2137

Change

One-token insertion in each of 4 pipelines — tr -d '\r' between head -1 and awk:

# Before:
COMMAND="$(printf '%s\n' "${COMMENT_BODY}" | head -1 | awk '{print $1}')"
# After:
COMMAND="$(printf '%s\n' "${COMMENT_BODY}" | head -1 | tr -d '\r' | awk '{print $1}')"

Files changed

  • .github/workflows/reusable-dispatch.yml — COMMAND (line 127) and SECOND_WORD (line 155)
  • internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml — COMMAND (line 82) and SECOND_WORD (line 110)

Both routers are kept in sync per repo conventions.

Test plan

  • Verify CI passes (actionlint, shellcheck, YAML lint)
  • Post /fs-triage with a multi-line body on a test issue and confirm triage agent triggers
  • Post bare /fs-fix (no body) on a test PR and confirm it still works (regression check)
  • Note: already-scaffolded repos retain old dispatch.yml until re-scaffolded

Closes #2137

Made with Cursor

@github-actions

Copy link
Copy Markdown

E2E tests did not run

E2E tests run automatically for org/repo members and collaborators on pull requests.

For other contributors, a maintainer must add the ok-to-test label after the latest push.

See E2E testing guide for details.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Site preview

Preview: https://3fcb05f8-site.fullsend-ai.workers.dev

Commit: 0ea6a36f6de404d4f98a8234dd0866c0c6124398

@fullsend-ai-review

Copy link
Copy Markdown

🤖 Review · Started 2:04 PM UTC
Commit: 9fea9a1 · View workflow run →

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

GitHub comment bodies use \r\n line endings. The `head -1 | awk` pipeline
preserved the \r, making COMMAND=/fs-fix\r which silently failed the
exact-match case statement. Add `tr -d '\r'` to all four extraction
pipelines in both dispatch routers.

Closes #2137

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Adam Scerra <ascerra@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Jun 11, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:08 PM UTC · Completed 2:15 PM UTC
Commit: 0ea6a36 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

Info

  • [edge-case-analysis] .github/workflows/reusable-dispatch.yml:127 — The fix correctly places tr -d '\r' between head -1 and awk in all 4 command-extraction pipelines across both dispatch routers. tr -d '\r' strips carriage returns without affecting valid slash commands. The fix is complete — no other head -1 | awk patterns on COMMENT_BODY exist in the codebase.

  • [latent-crlf] .github/workflows/reusable-fix.yml:227 — In reusable-fix.yml, COMMENT_BODY is extracted from EVENT_PAYLOAD via jq -r (which preserves \r), then prefix-stripped to produce the INSTRUCTION value. Embedded \r characters could reach the agent as free-form text. This is not a functional bug (the text is not exact-matched), but is a latent CRLF exposure outside the scope of this fix.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Jun 11, 2026
@ben-alkov

Copy link
Copy Markdown
Member

/ok-to-test

@ben-alkov ben-alkov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ascerra
ascerra added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit b566a23 Jun 11, 2026
16 checks passed
@ascerra
ascerra deleted the fix/2137-crlf-dispatch branch June 11, 2026 17:01
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jun 11, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 5:04 PM UTC · Completed 5:10 PM UTC
Commit: 0ea6a36 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #2168 — fix(dispatch): strip CRLF from comment body

Overall assessment: This workflow went well. A human-authored fix for a high-priority silent-failure bug (#2137) was opened, reviewed by the review agent, approved by two humans, and merged within ~3 hours. The review agent provided high-quality findings, including identifying a latent CRLF exposure in reusable-fix.yml that was outside the PR's scope.

Timeline:

  1. 2026-06-10 19:51 — Issue #2137 filed: CRLF \r in comment bodies causes slash commands to silently fail
  2. 2026-06-11 14:01 — PR #2168 opened by ascerra with tr -d '\r' fix across both dispatch files
  3. 2026-06-11 14:02 — Review agent run 27352388449 started, cancelled after ~5 min (superseded by push)
  4. 2026-06-11 14:06 — Review agent run 27352670894 started on final commit
  5. 2026-06-11 14:15 — Review agent posted findings: protected-path flag (medium), edge-case confirmation (info), latent CRLF in reusable-fix.yml (info)
  6. 2026-06-11 14:45 — Human approval (ben-alkov)
  7. 2026-06-11 15:13 — Human approval (rh-hemartin)
  8. 2026-06-11 17:01 — Merged

Skipped proposals (already covered):

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slash commands silently fail when comment body has multiple lines (CRLF \r not stripped)

3 participants