Skip to content

fix: frame intentional machine detach outcomes - #146

Merged
schickling-assistant merged 3 commits into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-07-31-machine-detach-outcome
Jul 31, 2026
Merged

fix: frame intentional machine detach outcomes#146
schickling-assistant merged 3 commits into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-07-31-machine-detach-outcome

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Why

Machine attach consumers currently see EOF without a terminal protocol outcome when a user intentionally detaches with Ctrl+\. That is indistinguishable from truncation, even though the attach command exits successfully.

Closes #151.

What

Emit the existing empty DETACH frame as the terminal machine-stream outcome for intentional local detach. Preserve EXIT for a session-process exit and preserve EOF-without-outcome for transport truncation.

How

A single guarded detach finalizer first queues DETACH on the machine descriptor, then notifies and disconnects the session socket, ends the machine writer without waiting on backpressure, and invokes the existing detach callback after the writer flushes. It accepts DETACH before the initial GEOMETRY/SCREEN baseline and prevents a pending detach timer from producing a second outcome after EXIT.

Proof

Posted on behalf of @schickling
field value
agent_name co1-sage
agent_session_id ed878dac-3735-4276-b3e0-ea1b1cd65291
agent_tool Codex CLI
agent_tool_version 0.145.0
agent_runtime Codex CLI 0.145.0
agent_model unknown
runtime_profile /nix/store/mnx8agbdq3wiyb6vz63lhgscgazkrn98-coding-agent-runtime-profile/share/coding-agents/profile.json
skills_manifest /nix/store/5r69m9k2llmri3na81518zx0a7y0d3cn-agent-skills-corpus/share/agent-skills/manifest.json
worktree pty/schickling-assistant/2026-07-31-machine-detach-outcome
machine dev3
tooling_profile dotfiles@0fb7e03

@schickling-assistant
schickling-assistant force-pushed the schickling-assistant/2026-07-31-machine-detach-outcome branch from 0e469fe to b58db0c Compare July 31, 2026 19:46
@schickling-assistant
schickling-assistant marked this pull request as ready for review July 31, 2026 19:46
@schickling-assistant
schickling-assistant merged commit a1f8236 into compoundingtech:main Jul 31, 2026
2 checks passed
@schickling-assistant

Copy link
Copy Markdown
Contributor Author

Merged with the repro, protocol contract, and exact outcome tests all aligned. Thank you, Nathan, for the careful sequencing and review — intentional detach is finally distinguishable from transport loss.

celebration

Posted on behalf of @schickling
field value
agent_name co1-sage
agent_session_id ed878dac-3735-4276-b3e0-ea1b1cd65291
agent_tool Codex CLI
agent_tool_version 0.145.0
agent_runtime Codex CLI 0.145.0
agent_model unknown
runtime_profile /nix/store/mnx8agbdq3wiyb6vz63lhgscgazkrn98-coding-agent-runtime-profile/share/coding-agents/profile.json
skills_manifest /nix/store/5r69m9k2llmri3na81518zx0a7y0d3cn-agent-skills-corpus/share/agent-skills/manifest.json
worktree dotfiles/schickling/2026-07-20-cos-misc
machine dev3
tooling_profile dotfiles@0fb7e03

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Machine attach local detach ends without a framed outcome

2 participants