Skip to content

feat(stats): expose connected client geometry - #136

Merged
myobie merged 4 commits into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-07-31-stats-client-introspection
Jul 31, 2026
Merged

feat(stats): expose connected client geometry#136
myobie merged 4 commits into
compoundingtech:mainfrom
schickling-assistant:schickling-assistant/2026-07-31-stats-client-introspection

Conversation

@schickling-assistant

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

Copy link
Copy Markdown
Contributor

Why

pty stats --json and queryStats() already expose the effective terminal geometry and aggregate client counts through a non-attaching STATUS request. They do not explain which connected clients requested that geometry or which client currently determines each min-wins axis.

Relates to #134. This improves point-in-time observability; it does not solve the ordered geometry-before-DATA requirement described there.

What

  • Add anonymous clients.connections details while preserving all existing stats fields and semantics.
  • Report each writable client's requested rows and columns, its daemon-local last request sequence, and independent row/column constraint flags.
  • Distinguish readonly clients without assigning a fabricated identity or exposing socket/parser internals.
  • Re-negotiate when an attached client switches to PEEK, so its former size constraint is actually released.
  • Document the current-versus-new contract and its point-in-time limitation.

How

The server projects the client state it already retains for size negotiation into the STATUS response. Query connections that have not attached remain excluded, matching the existing aggregate counts. Constraint flags compare each writable request with the current effective terminal dimensions, so tied minima are represented correctly.

Attach and resize arbitration remains min-wins. The only negotiation behavior change is the public-protocol ATTACH -> PEEK transition: becoming readonly now relinquishes that connection's requested geometry and notifies remaining clients if the effective size changes.

Validation

Current head: 2bc1f63

  • CI=1 npm run typecheck
  • CI=1 npm run build
  • CI=1 npm test -- tests/protocol.test.ts tests/integration.test.ts -t 'STATUS|reports anonymous client geometry|old-daemon|relinquishes' (15 passed)
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-stats-client-introspection
machine dev3
tooling_profile dotfiles@0fb7e03

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64edbe21be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/client.ts Outdated
@schickling-assistant
schickling-assistant marked this pull request as draft July 31, 2026 09:57
@schickling-assistant
schickling-assistant force-pushed the schickling-assistant/2026-07-31-stats-client-introspection branch from 1a0477d to e5a2686 Compare July 31, 2026 10:01
@schickling-assistant
schickling-assistant marked this pull request as ready for review July 31, 2026 10:03
@schickling-assistant

Copy link
Copy Markdown
Contributor Author

@codex review

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

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@schickling

Copy link
Copy Markdown
Contributor

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5a2686892

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/server.ts
@myobie
myobie merged commit cc7a59b into compoundingtech:main Jul 31, 2026
2 checks passed
@schickling-assistant

Copy link
Copy Markdown
Contributor Author

Thank you, Nathan — especially for tightening the PEEK semantics and polishing the contract before merge. This gives Fractal both the ordered geometry primitive and the non-attaching client introspection we needed.

Happy dance

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-stats-client-introspection
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.

3 participants