fix: preserve cwd for Codex handoffs - #27326
Conversation
This comment was marked as spam.
This comment was marked as spam.
|
Thanks for the focused handoff fix. The underlying failure remains on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Two PRs touch the CLI-to-gateway handoff path but address distinct causes: #27326 preserves the originating workspace for Codex after handoff, while #65505 carries an explicit Discord initiator into newly created handoff threads. Neither current diff is merge-ready because each introduces or reuses the wrong persistence path for its data.
Related pull requests
- #27326
related— (+138/-15) — keep open and rework: The diff captures the CLI cwd and propagates it to the Codex app-server, addressing the reported wrong-workspace failure, but it creates a competinghandoff_cwdalongside the existingsessions.cwdand updates onlyagent.session_cwd, leaving gateway context-file and other runtime-cwd consumers on fallback resolution. This agrees with the keep_open review on #27326: salvage the fix by usingsessions.cwdand propagating it through the current gateway cwd-resolution path. - #65505
related— (+199/-10) — keep open and rework separately: The diff adds the missing Discord initiator argument and inserts that member into both direct and fallback-created threads, but transports the value through durablesessions.user_id; this can overwrite ownership metadata and clear it for existing no-ID handoff callers. This agrees with the keep_open review on #65505: use a handoff-specific initiator field and add preservation coverage for both explicit-ID and no-ID paths.
Suggested consolidation
Do not merge or deduplicate these PRs as-is: rework #27326 around the canonical sessions.cwd and complete gateway cwd propagation, and keep #65505 separate because it fixes Discord thread membership rather than cwd restoration. After their respective blocking review concerns are resolved, they can be evaluated independently; neither PR should be closed as a duplicate of the other.
Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 32 kB of PR diffs, 3 kB of issue/PR text, 3 kB of discussion (4 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
What does this PR do?
Preserves the CLI working directory when
/handoff <platform>moves a session into the gateway, so Codex app-server starts in the original project instead of the gateway install directory.The change keeps the scope narrow:
/handoffmarks the session pendingAIAgentfor that gateway sessionWhy?
Without this, a handoff from a project directory can continue from Slack while Codex app-server starts from the Hermes install cwd, so Codex loads the wrong local context and answers from the wrong workspace.
Related: #21427 covers broader resume cwd restoration. This PR is narrower and handoff-specific.
How has this been tested?
scripts/run_tests.sh tests/hermes_cli/test_session_handoff.py tests/gateway/test_session.py tests/agent/transports/test_codex_app_server_runtime.py -qgit diff --checkPlatform tested: macOS.