worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

[ci] some issues on #1286

Open max-sixty opened this issue 8 months ago • 4 comments

Some issues with https://github.com/max-sixty/worktrunk/pull/1286; could you diagnose and attempt to fix?

  • @worktrunk-bot didn't wait for the tests to pass before completing the initial changes as part of the message at https://github.com/max-sixty/worktrunk/pull/1286#issuecomment-4006237969
  • @worktrunk-bot didn't respond to https://github.com/max-sixty/worktrunk/pull/1286#issuecomment-4006301247
  • we had the often-present issue with escaping ! in https://github.com/max-sixty/worktrunk/pull/1286#issuecomment-4008045413
    • we should design our suggestions for how it responds to comments to use heredocs or files, to avoid this problem; it's annoyingly common in claude

max-sixty avatar Mar 05 '26 21:03 max-sixty

Diagnosed all three issues and opened #1289 to address the ones fixable through skill changes.

1. Bot didn't wait for CI before saying "done"

The running-in-ci skill said "do not return until CI is green" but this wasn't prominent enough. The bot posted "Done" at 16:19 without waiting for CI to complete. Fixed by rewriting the CI monitoring section to be more explicit: the word "done" must not appear in a comment until checks are green, with a concrete step-by-step workflow (push → wait → check → report).

2. Bot didn't respond to "fix tests pls"

This one is trickier. The claude-mention workflow should have triggered — the bot was engaged (it authored the PR and had commented), so the verify step would pass. The non-mention prompt tells Claude to "lean toward responding" when it authored the PR/issue.

Possible explanations:

  • The workflow run may have been cancelled by cancel-in-progress: true if it overlapped with another event on the same PR
  • The workflow may have triggered but Claude decided the comment wasn't actionable without more context (the CI hadn't posted failure results yet at 16:28)
  • GitHub Actions may not have triggered the workflow at all (transient platform issue)

Without the workflow run logs from that window it's hard to pin down which. This isn't easily fixable through skill/prompt changes — if the workflow didn't run, no amount of prompt improvement helps. If it did run but Claude chose not to respond, the prompt already says to lean toward responding when it's the author. The second mention at 21:39 worked correctly.

3. ! escaping in comment bodies

The bot's comment at 21:52 had format\! — bash history expansion mangling ! in double-quoted strings. The skill already had a shell quoting section but it only showed GraphQL and jq examples. Fixed by:

  • Making the rule more prominent ("this is the most common source of broken bot comments")
  • Adding the most common case first: posting comment and review reply bodies via temp files
  • Adding a clear rule: always use a temp file for comment/reply bodies, never inline -f body="..."

worktrunk-bot avatar Mar 05 '26 22:03 worktrunk-bot

Without the workflow run logs from that window it's hard to pin down which. This isn't easily fixable through skill/prompt changes — if the workflow didn't run, no amount of prompt improvement helps. If it did run but Claude chose not to respond, the prompt already says to lean toward responding when it's the author. The second mention at 21:39 worked correctly.

I don't understand — you should be looking at the logs! do we not have that somewhere like a skill? maybe it's only in the prompt in the CI job definitions?

max-sixty avatar Mar 05 '26 23:03 max-sixty

(other changes are great, thanks!)

max-sixty avatar Mar 05 '26 23:03 max-sixty

You're right, I should have checked the logs instead of speculating. Here's what actually happened:

The workflow did trigger for the "fix tests pls" comment — run 22727587093 was created at 16:41 UTC (13-minute queue delay from the 16:28 comment). But it failed to acquire a runner:

The job was not acquired by Runner of type hosted even after multiple attempts

This was a GitHub Actions infrastructure issue — the job never ran Claude at all. The runner pool couldn't allocate a hosted runner, so the entire run failed before any step executed.

So the root cause for issue 2 is: GitHub Actions runner availability, not a prompt/skill problem. The workflow was correctly triggered and would have responded (the bot authored the PR, so the verify step would pass). It just never got a machine to run on.

Nothing actionable on our side for this one — it's transient GitHub infrastructure. The second mention at 21:39 worked fine on the same workflow.

worktrunk-bot avatar Mar 05 '26 23:03 worktrunk-bot