fix(session): export AO_RUN_FILE to spawned sessions so hook delivery finds the spawning daemon#2399
Open
rep-de wants to merge 1 commit into
Open
fix(session): export AO_RUN_FILE to spawned sessions so hook delivery finds the spawning daemon#2399rep-de wants to merge 1 commit into
rep-de wants to merge 1 commit into
Conversation
… finds the spawning daemon Sessions inherited AO_DATA_DIR but not AO_RUN_FILE; with a non-default state location, every 'ao hooks' callback fell back to ~/.ao/running.json and failed (all sessions no_signal, permission dialogs undetected, observed 2026-07-04). Mirrors SIGNAL_REPORT fix proposal AgentWrapper#2.
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.
Root cause
Spawned sessions inherit
AO_DATA_DIRbut notAO_RUN_FILE. When the daemon runs with a non-default run file (workspace-local state), everyao hookscallback inside a spawned session resolves the default~/.ao/running.json, which is stale or absent — hook delivery fails silently: sessions showno_signal, and permission dialogs never surface as blocked activity.Repro sketch
AO_RUN_FILE.ao hookscallback inside the spawned session.~/.ao/running.jsoninstead of the spawning daemon's run file; activity staysno_signal, and permission dialogs do not surface as blocked activity.Fix
Export
AO_RUN_FILEinto the spawn environment alongsideAO_DATA_DIR, with AO-internal environment variables applied after project env so projects cannot override the run file. If the daemon has no resolved run-file path, omitAO_RUN_FILErather than exporting an empty value.Tests
Added/updated session manager provision tests to assert project env cannot override
AO_RUN_FILEand empty run-file values are omitted.Validated with:
cd backend && go build ./...cd backend && go test ./...Interim workaround
Hit in production orchestration on 2026-07-04 with v0.10.2. Until this lands, a
~/.ao/running.jsonsymlink to the workspace run file keeps hook delivery pointed at the live daemon.🤖 Generated with Claude Code