Fix codex subagent indexing, search cwd, and broken-pipe exits - #2
Open
caffeinum wants to merge 4 commits into
Open
Fix codex subagent indexing, search cwd, and broken-pipe exits#2caffeinum wants to merge 4 commits into
caffeinum wants to merge 4 commits into
Conversation
Discovery returns sessions newest-first, and a forked subagent always starts after the session that spawned it. sessions.parent_id is a foreign key, so linking a child that reached the indexer first aborted the insert with FOREIGN KEY constraint failed and dropped the session entirely — a backfill of one coordinator plus three subagents lost all three. Sort linked sessions after their parents, write the link only when the parent row exists, and apply the rest after the pass so nesting resolves too. A parent that is never indexed now leaves the child indexed and unlinked with a reported reason instead of failing the session. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A search hit named the session but not where it ran, so following a result back to the repo it came from needed a second inspect call per session. The enrichment pass already loads the session row; carry cwd through to JSON and the human table. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rust ignores SIGPIPE at startup, so `gaal inspect ... | head` turned a closed downstream pipe into an EPIPE write error: JSON commands reported "The command failed: Broken pipe (os error 32)" and exited non-zero, human output panicked out of println!. Restore the default SIGPIPE disposition so gaal dies on a closed pipe like every other CLI, and treat a broken pipe that still reaches the error path as a silent exit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three failures unrelated to any code change: handoff_frontmatter_uses_local_date hardcoded the local date of a 23:43 UTC timestamp, which only holds at UTC+1 or east. Derive the expectation from the fixture instead. The agy batch-handoff and grok search tests passed a relative `--since 30d` (or relied on the search default) against fixtures with fixed dates, so they started failing once the fixtures aged past the window. Pin absolute lower bounds, as the surrounding agy assertions already do. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Three reported bugs, plus the test failures that were blocking the verification gate.
1. Codex subagents failed to index behind their parent
All three are subagents of
4105a92a— indexed at position 9, after its ownchildren. Discovery is newest-first and a fork always starts after the session
that spawned it, so children reached the indexer first;
sessions.parent_idisa foreign key, so the insert aborted and the session was dropped entirely.
Hermes-only rule, generalized — Codex needed it for the same reason).
subagent with the link unset, and says so:
-> session 9767dfaf: parent 4105a92a is not indexed; link left unsetLosing the whole session to keep a foreign key was the wrong trade.
2.
gaal searchdid not reportcwdA hit named the session but not where it ran, so getting back to the repo took a
second
inspectper session. The enrichment pass already loads the session row;cwdnow rides along in JSON and in the-Htable.3.
gaal ... | headreported a failureRust ignores
SIGPIPEat startup, so a closed downstream pipe surfaced as anEPIPE write error — an error payload and non-zero exit for JSON commands, a
println!panic for human output. Gaal now restores the default disposition anddies on
SIGPIPE(141) with clean stderr, like every other CLI.Test failures that were already red on master
cargo testfails on master before any of the above:handoff_frontmatter_uses_local_datehardcoded the local date of a 23:43 UTCtimestamp — true only at UTC+1 or east, false in US timezones.
--since 30d(orthe search default) against fixtures with fixed dates, and those fixtures aged
past the window. Pinned to absolute bounds, matching the surrounding agy
assertions.
Verification
tests/integration/codex.rswith a sanitized fixture (coordinator +two subagents + one subagent whose parent has no trace). Each test was
confirmed to fail with the fix reverted and pass with it.
cargo fmt --check,cargo clippy --all-targets,cargo test(203 tests),./tests/run-all.sh— all green.gave
"errors": 3now indexes 9/9 with the three subagents linked to4105a92aand that parent promoted to coordinator.Opened from a fork — the account on this machine has read-only access to
buildoak/gaal.🤖 Generated with Claude Code