Skip to content

docs: the stdio protocol doc describes the wire that ships - #286

Merged
Max17190 merged 1 commit into
mainfrom
stdio-doc-describes-the-wire-that-ships
Sep 2, 2026
Merged

docs: the stdio protocol doc describes the wire that ships#286
Max17190 merged 1 commit into
mainfrom
stdio-doc-describes-the-wire-that-ships

Conversation

@Max17190

@Max17190 Max17190 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Why

docs/stdio-protocol.md calls itself the normative reference for every field of every line and documents openmax-stdio/3. The binary speaks /5, and openmax --check --stdio rejects a /3 hello on its first line, so a client written from the doc fails conformance before it sends a command. Two events and two stop reasons that core emits today are named nowhere a client author would look.

Summary

  • docs/stdio-protocol.md now matches openmax --spec stdio: the hello line carries continued; the event table gains harness_note, compacted, turn_refused, and the optional approval_request.env with the rendering rule for it; the stop_reason table gains budget_exhausted and unverified; the process exit code is stated; one "what changed" section per bump, in the order the bumps happened.
  • The printed contract (spec.rs) omitted continued from its hello line while the binary emits it.
  • The Done doc comment on the wire type listed six stop reasons; the loop emits eight. All eight are described.
  • The stdio module doc pointed at a README section that does not exist; it now points at the doc and the spec.
  • README named the /3 contract twice.
  • The usage doc referred to a delegate skill the tree stopped shipping in chore(skills): the tree's extension surfaces ship empty #240.
  • The configuration example omitted context_tokens, which the text two paragraphs later calls required.

No behavior change: documentation, one string in the printed spec, and two doc comments.

Test Plan

  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
  • cargo test --workspace --locked: 944 passed, 11 ignored, 0 failed. The stdio spec drift tests and the wire golden pass unchanged.
  • Every field, stop reason, and exit code in the doc was checked against crates/tui/src/stdio.rs, crates/tui/src/headless.rs, crates/core/src/agent.rs, and the output of openmax --spec stdio from a release build.

Greptile Summary

Updates the stdio protocol reference and related documentation for the shipped openmax-stdio/5 contract. The documented /5 handshake, legacy /3 rejection, harness_note and turn_refused envelopes, and provider-error completion behavior were exercised against the CLI and matched the documentation. No defects were found.

Confidence Score: 5/5

Safe to merge based on the exercised stdio protocol and error-handling flows.

The final review contains no findings: the live CLI behavior and generated protocol validation agreed with the updated documentation.

Files Needing Attention: None. The changed documentation files were consistent with the tested CLI contract.

T-Rex T-Rex Logs

What T-Rex did

  • The saved validation script was executed successfully.
  • The logs show the shipped CLI rejects an openmax-stdio/3 hello as unsupported, then emits openmax-stdio/5 and protocol version 5 during a live stdio session.
  • The validation confirms that the newly documented harness_note and turn_refused envelopes are accepted through --check --stdio.
  • When a provider connection failure occurs, the CLI exits with code 1 after emitting error and done, with stop_reason: error.
  • The observed behaviors align with the updated documentation.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "docs: the stdio protocol doc describes t..." | Re-trigger Greptile

docs/stdio-protocol.md called itself the normative reference and documented
openmax-stdio/3 while the binary speaks /5 and `--check --stdio` rejects a
/3 hello on its first line. A client written from the doc failed conformance
before it sent a command. The doc now matches `openmax --spec stdio`: the
hello line carries `continued`; the event table gains `harness_note`,
`compacted`, `turn_refused`, and the optional `approval_request.env`; the
stop_reason table gains `budget_exhausted` and `unverified`, both emitted
by core and mapped by every frontend but named nowhere; and the process
exit code is stated. One "what changed" section per bump.

The printed contract omitted `continued` from its hello line while the
binary emits it. The `Done` doc comment on the wire type listed six stop
reasons and the loop emits eight. The stdio module doc pointed at a README
section that does not exist. README named the /3 contract twice. The usage
doc referred to a `delegate` skill the tree stopped shipping in #240. The
configuration example omitted `context_tokens`, the one field the text two
paragraphs later calls required.
@Max17190
Max17190 merged commit 709240d into main Sep 2, 2026
4 checks passed
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.

1 participant