Skip to content

feat(client): add read-only terminal region queries - #138

Closed
schickling-assistant wants to merge 1 commit into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-07-31-authoritative-snapshot-stream
Closed

feat(client): add read-only terminal region queries#138
schickling-assistant wants to merge 1 commit into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-07-31-authoritative-snapshot-stream

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Why

Related to #134. Embedded browse, pan, and scan surfaces need a stable view of
the daemon's terminal model without attaching a writable client or changing the
shared PTY geometry.

This is a read-only alternative to #135 for those surfaces. It does not replace
the streamed effective-geometry approach for realtime writable clients.

What

  • Add a bounded terminal-region request/response to the socket protocol.
  • Add queryTerminalRegion() to the programmatic client API.
  • Return daemon generation, terminal revision, effective geometry, active-buffer
    metadata, cursor and mode state, and structured cells.

How

The daemon queues each query behind an xterm write callback, then copies the
requested region synchronously. This makes generation, revision, geometry, and
cells describe one terminal-model state without timing heuristics.

Query sockets are read-only, never send ATTACH, and have no requested terminal
geometry. They therefore do not participate in min-wins negotiation, trigger
SIGWINCH, or update attach metadata.

Colors use tagged default, palette, and rgb values. Requests are capped at
100,000 cells and responses retain the protocol's 32 MiB packet limit.

Scope and limits

  • Polling only; no realtime subscription in this change.
  • Bounded regions can scan retained scrollback, but there is no one-shot
    unbounded scrollback response.
  • The response reflects xterm-headless's terminal model, not renderer output.
  • Palette indexes are preserved, but palette definitions are not.
  • OSC 8 metadata, graphics protocols, fonts, and glyph rendering are out of
    scope.
  • Client geometry detail remains the responsibility of stats APIs.

Verification

  • npm run typecheck
  • npm run build
  • Focused protocol, integration, and client tests: 7 passed
  • Full test/docs gates and remote CI are pending while this PR remains draft
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-authoritative-snapshot-stream
machine dev3
tooling_profile dotfiles@0fb7e03

@schickling
schickling marked this pull request as ready for review July 31, 2026 09:47
@schickling-assistant

Copy link
Copy Markdown
Contributor Author

Closing this draft because its protocol IDs collide with active upstream protocol work (#131 ACTIVITY and #133 GUARDED_DATA). The unsupported-server behavior and overlap with the evolving revision contract also need an explicit capability/version design before this can be proposed safely.

Preserving the branch and commit as investigation evidence; no code is being deleted.

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-authoritative-snapshot-stream
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.

1 participant