fix.sh: the emit_observe fallback reads its own token before the agent CLI renders it, so it always reports not_found
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- bash, shell
- Domain
- cli, developer-experience, tooling
Research direction
Start in fix.sh and scripts/lib/token-locate.sh (agmsg_token_locate_self): the emit_observe path prints a token then immediately scans panes in the same invocation, which misses output the agent CLI only renders after the tool returns. Split print vs observe across two steps after the seat’s completion signal, keep the token out of the state= field, and measure (read-only) why ancestry proof failed on a live Codex seat. Done when self-locate no longer always returns undetermined reason=not_found via emit_observe.
Written by the indexing model from the issue text.
Description
What
fix.sh falls back to agmsg_token_locate_self (scripts/lib/token-locate.sh) when the process-ancestry proof cannot place the seat. That function prints a token to its own stdout and then, inside the same call, reads every pane the census can reach to find the token.
When fix.sh runs as an agent's tool call, the agent CLI renders the command's output only after the command returns. So during that call the token is not in any pane yet, and the result is always undetermined reason=not_found.
Observed
A Codex seat asked to self-fix:
fix seat=<team>/<agent> state=AGMSG_LOCATE_TOKEN(<team>/<agent>): agmsg-locate-a1237322
undetermined reason=not_found via=emit_observe (written nothing)
Measured from a Claude Code seat on herdr, with no fix.sh involved:
- Printed a token, waited 2s, and read the seat's own pane in the same tool call: 0 matches.
- Read the same pane again after that call returned: 1 match.
The file's own header already says that reading on a timer misses the token, and that the caller must wait for the seat's completion signal before reading. The fallback in the same file does not do that.
A side issue: the state= field in the line above shows the token line rather than a state. The token printed to stdout seems to be captured into the state field.
To do
- Split emit and observe into two steps. One call prints the token and returns. A later call, made after the seat's own turn has rendered, reads the panes. How the seat triggers the second step (a second
fix.shinvocation, or a follow-up the agent runs) is open. - Find out why the ancestry proof failed for this Codex seat. Codex's process tree may not reach the herdr pane from a tool call. Measure it on a live Codex seat (read-only).
- Fix the
state=field so the token line does not end up in it.
Seat identity feeds poke and the monitor, so a seat that cannot place itself cannot be poked reliably.
- Dominant language
- Shell
- Stars
- 1.5k
- Forks
- 156
- Avg merge
- 16h 23m
- Merged PRs (30d)
- 197
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fujibee/agmsg
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
[P2] app: peer-message previews pass C0/DEL control bytes to pty_injectPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
Similar issues
-
bug linux priority-low
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
chart-check misses a config variable whose env call spans linesPossibly taken @thebadalov claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kubemg/kubemg#291 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rossoctl/automation#130 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
btclib-org/claude-process#295 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100