Skip to content

fix(follow): say why task state could not be read - #54

Open
ancelin-code wants to merge 1 commit into
developfrom
fix/follow-state-error
Open

ancelin-code wants to merge 1 commit into
developfrom
fix/follow-state-error

Conversation

@ancelin-code

Copy link
Copy Markdown
Owner

What and why

follow.sh printed ERROR task state could not be read (attempt N) a few times an hour in the tiroir retrieval cut, with no cause (feedback item 3). Finding it meant wrapping status.sh with --status-script. The cause was hidden twice: follow.sh ran status.sh 2>/dev/null, and status.sh ran gh pr list … 2>/dev/null.

Now status.sh adds gh's first stderr line to its "gh could not list pull requests" message, and follow.sh adds status.sh's first stderr line, minus its ERROR prefix, to the event:

ERROR	task state could not be read (attempt 1): gh could not list pull requests in tiroir: proxyconnect tcp: … i/o timeout; check 'gh auth status' and the remote

How to review

Two small hunks: pr_heads in etabli-status/scripts/status.sh, and the top of the poll loop in etabli-orchestrator/scripts/follow.sh. Only the first line is kept, so a stack of output cannot flood the event stream.

How to try it

Point follow.sh --status-script at a script that writes a line to stderr and exits 1: the event ends with that line. The tests do exactly that, and a fake gh that fails with a reason shows it in status.sh's error.

Does it earn its place?

A proxy timeout and an expired gh login need different fixes, and an agent watching the loop cannot tell them apart without the cause. The event keeps its name and first field, so a watcher matching ERROR is unaffected.

🤖 Generated with Claude Code

follow.sh discarded status.sh's stderr, and status.sh discarded gh's, so a
proxy timeout surfaced only as "task state could not be read". The ERROR
event now carries status.sh's first line, which carries gh's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ai-assisted AI agents worked on this change label Nov 10, 2026

This branch has not been deployed

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

Labels

ai-assisted AI agents worked on this change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant