Skip to content

fix: require attach before resize - #154

Merged
schickling-assistant merged 3 commits into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-08-01-resize-after-attach
Aug 1, 2026
Merged

fix: require attach before resize#154
schickling-assistant merged 3 commits into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-08-01-resize-after-attach

Conversation

@schickling-assistant

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

Copy link
Copy Markdown
Contributor

Why

A fresh command socket can currently send RESIZE before ATTACH. That admits
it as a writable geometry participant and changes the shared grid even though
the socket has not requested a screen baseline.

What

  • Require a complete writable ATTACH before accepting RESIZE.
  • Add a causal protocol regression that preserves pre-ATTACH DATA and
    STATUS while proving the command socket cannot affect geometry or attached
    client counts.
  • Specify command, readonly, and writable-attached capabilities consistently in
    the VRS documents.

Rationale

The fix reuses attachSeq > 0, which is already the server's predicate for
stats, geometry negotiation, and geometry broadcasts. It preserves intentional
command input without introducing a new protocol frame or broad role-state
refactor.

Verification

  • Focused regression: passed.
  • TypeScript build: passed.
  • Typecheck: passed.
  • VRS verification: passed, 2 documents / 11 requirement IDs.
  • Diff check: passed.

Reproduction:
https://github.com/schickling-repros/2026-08-pty-resize-before-attach/tree/cef285ea85de3b750aa6dc341a560a58f77b07fd

Closes #153

Posted on behalf of @schickling
field value
agent_name co1-sage
agent_tool Codex CLI
agent_tool_version 0.145.0
agent_runtime Codex CLI 0.145.0
agent_session_lookup sha256:ad381a588faa911d70bf08ee2ae4305e96d980701e6405897e32fe38c3163d98
tooling_profile dotfiles@de765ec

@myobie

myobie commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

I reviewed exact draft head 9e1eafc. I like this direction. The implementation is narrow: a fresh command socket can still send input and request status, but RESIZE is ignored until a complete ATTACH has established geometry membership. The regression also proves that the ignored resize does not change terminal geometry, emit GEOMETRY, start a screen baseline, or add the command socket to public attached-client stats. Hosted build and Vitest checks are green.

One non-blocking design note: !client.readonly && client.attachSeq > 0 represents the role through two existing fields. That is correct for the current three roles. If the protocol adds another role later, an explicit role value could make the state machine easier to audit. I do not see that as a reason to expand this draft now.

@schickling-assistant
schickling-assistant marked this pull request as ready for review August 1, 2026 09:12
@schickling-assistant
schickling-assistant merged commit 025a903 into compoundingtech:main Aug 1, 2026
2 checks passed
@schickling-assistant

Copy link
Copy Markdown
Contributor Author

Thank you, Nathan, for the careful push to clarify the actual client contract before changing resize behavior. The resulting boundary is much simpler: command sockets keep DATA and STATUS, while geometry authority begins only after writable ATTACH.

Kermit celebration

Posted on behalf of @schickling
field value
agent_name co1-sage
agent_tool Codex CLI
agent_tool_version 0.145.0
agent_runtime Codex CLI 0.145.0
agent_session_lookup sha256:ad381a588faa911d70bf08ee2ae4305e96d980701e6405897e32fe38c3163d98
tooling_profile dotfiles@de765ec

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.

RESIZE before ATTACH acquires geometry authority without a screen baseline

2 participants