GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(id): bounded in-band terminal detector in SSH and client TTY adapters (#786 Phase 2) by dezren39 · Pull Request #5023 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

What

Phase 2 of the F13.4 plan for #786: wire the Phase 1 capability detector into both TTY-owning adapters behind one bounded startup deadline, demultiplexing probe replies out of world input. Only the Tier 3 safe fallback is enabled; every richer presenter stays unreachable until Phase 3.

Queue task: repo-health-code-pilot task 8067 (issue #786). Phase 1 landed as #3929 (38eba55e).

Changes

  • pkgs/id/src/world_terminal.rs
    • One tokenizer (scan_step) now serves both whole-transcript parsing and the streaming adapter path, so SSH and iroh classify the same bytes identically.
    • ProbeDemux: streaming, order-preserving demultiplexer. It forwards unmatched bytes immediately and holds back only a possible reply prefix (plus everything behind it) until the reply completes or the deadline expires. Consumed replies never reach world input.
    • probe_local_tty(): one probe burst, one 250 ms deadline, replies read through libc::poll in non-canonical mode with a terminal-mode guard restored on every return path. Returns None when stdin or stdout is not a TTY, so piped/scripted callers send no probe bytes.
  • pkgs/id/src/world_ssh.rs
    • A raw shell that owns a PTY writes the probe burst once, immediately after entering the alternate screen, and opens one deadline window.
    • Bytes received while the window is open pass through the demux before raw_frame; reply bytes are consumed, unmatched keystrokes are forwarded in arrival order, and held prefixes are flushed at the deadline.
    • Command mode, exec channels and PTY-less callers are untouched: no probe bytes, same behavior as before.
  • pkgs/id/src/commands/world.rs
    • The client TTY pump replays keystrokes captured during the probe into the line reader first, in order (PreloadedStdin).
    • Applies to both --via iroh and --via ssh; non-TTY callers keep the current JSON-lines behavior.
  • No shell-contract change, no journal change, no presenter routing. The detected tier is logged only (Tier 3 fallback stays active).

Tests

  • cargo test --lib --no-default-features --features world world_terminal:: — 11 passed. Includes a cross-adapter matrix asserting TerminalNegotiator (iroh seam) and ProbeDemux (SSH path) select identical tiers, profiles, conflict flags and replay bytes for tier-1, tier-2, no-reply, malformed, partial-late and interleaved-key transcripts, plus demux ordering tests.
  • cargo test --lib --no-default-features --features ssh world_ssh::tests::a_raw_shell... — probe burst written exactly once; interleaved reply+key bytes reach the world as jk only.
  • cargo test --lib --no-default-features --features ssh world_ssh::tests::a_shell_without_a_pty... — no probe bytes for a TTY-less caller.
  • Existing alternate-screen and command-mode tests still pass.

Notes for the reviewing worker

  • Phase 3 (Tier 2 cell presenter, Tier 3 coalesced text deltas, interactive iroh TTY presentation) is the separate next packet under id: Phase 13 F13.4 presentation capability tiers with in-band terminal detection #786; prerequisites id: server-side redraw batching (few-ms frame coalescing) for all presentations #561 and id(ssh): incremental (diff) ANSI renderer instead of full clear-repaint #562 are closed.
  • This PR was opened after the queue lease for task 8067 expired mid-run (heartbeat missed by ~1 minute at 2026-11-03T16:14Z). The work product is complete and pushed here; the resumed task owner should adopt this PR as the canonical one and drive it to merge rather than restarting.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 16:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T16:31:33.249747Z
We couldn’t complete this review. Comment @codex review to try again.
55da427 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f9338f2f-af91-4c95-bc7d-2e5cc0851d9f
Commits

Reviewing files that changed from the base of the PR and between fc0825d and cb220b8.

Files selected for processing: 3

  • pkgs/id/src/commands/world.rs
  • pkgs/id/src/world_ssh.rs
  • pkgs/id/src/world_terminal.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 mentioned this pull request Nov 3, 2026
id: Phase 13 F13.4 presentation capability tiers with in-band terminal detection #786
Closed
3 tasks
@github-actions github-actions Bot assigned dezren39 Nov 3, 2026
@developing-today developing-today Bot mentioned this pull request Nov 8, 2026
Unowned PR batch from branch disposition (2026-11-07) #7297
Open
repo-worker-code repo-worker-code-k
feat(id): bound terminal detector in SSH and client TTY adapters (#786)
cb220b8
Phase 2 of the F13.4 plan: wire the Phase 1 capability detector into both
TTY-owning adapters behind one startup deadline, and demultiplex probe
replies out of world input. Only the Tier 3 safe fallback is enabled;
richer presenters stay unreachable until Phase 3.

world_terminal:
- one scan_step tokenizer serves whole-transcript parsing and the live
  stream, so SSH and iroh classify identical bytes identically;
- ProbeDemux forwards unmatched bytes in arrival order and holds only a
  possible reply prefix (and the bytes behind it) until it resolves or the
  deadline expires, so replay can never reorder;
- probe_local_tty() writes the burst once, reads replies through libc poll
  in non-canonical mode with a Drop guard restoring the terminal, and
  returns None when either stream is not a TTY (no probe bytes).

world_ssh:
- a raw shell with a PTY probes once after the alternate screen, feeds
  bytes through the demux until the 250 ms deadline, and never turns a
  reply into an input frame; command mode, exec channels and PTY-less
  callers are unchanged.

commands/world:
- keys typed while the probe ran are replayed ahead of live stdin in
  order; non-TTY callers keep the JSON-lines behavior.

No shell-contract, journal or presenter routing change.
@dezren39
dezren39 force-pushed the queue/8067-786-terminal-inband-detector branch from 70b85ac to cb220b8 Compare November 8, 2026 22:52
@developing-today
developing-today Bot merged commit 5ad9688 into main Nov 8, 2026
1 of 6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@developing-today
developing-today Bot deleted the queue/8067-786-terminal-inband-detector branch November 8, 2026 22:58
This was referenced Nov 17, 2026
id: implement remaining F13.4 presentation tiers and acceptance (#786) #10888
Closed
feat(id): F13.4 tier presenters for SSH and iroh TTY (#10888) #11189
Merged
@dezren39 dezren39 added the audit:partial PR partially implemented; gap filed label Nov 24, 2026
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

audit:partial PR partially implemented; gap filed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.