Skip to content

Label raw terminal setup phases and retry capability issuance - #6320

Draft
schickling-assistant wants to merge 3 commits into
mainfrom
schickling-assistant/2026-11-10-raw-attach-phases
Draft

schickling-assistant wants to merge 3 commits into
mainfrom
schickling-assistant/2026-11-10-raw-attach-phases

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Make raw-terminal setup failures diagnosable through cancellation and first presentation, and retry only the setup step that opens no PTY.

Change

  • Phase-specific capability and combined connect/upgrade timeout status; no timeout increase. Capability-only retry is bounded to two retries with 1s/2s backoff and preserves the selected incarnation. Upgrade timeouts remain manual Ctrl-R because client cancellation does not acknowledge remote cleanup.
  • Attempt UUID plus target agent, wall/monotonic timing and phase reached. Terminal-once outcomes include outer deadline, selection change, failed setup and drop; phase guards also record cancellation.
  • Every non-success terminal outcome emits one INFO tracing event and is retained by the normal TUI cache logger at $XDG_CACHE_HOME/st3/stui/attach.log (otherwise ~/.cache/st3/stui/attach.log), with the existing cache-log permissions and 100 KB reset bound. No subscriber or opt-in setting is required for that file.
  • Detailed starts/successes use an explicit private JSONL sink: FRACTAL_TUI_ATTACH_TRACE_FILE="$HOME/raw-attach.jsonl" fractal ui --client. Existing files must be regular, owned by the user, single-link, non-symlink and mode0600. The best-effort sink caps at4MiB without truncation and never waits on another process's log lock. No terminal payload, capability or error text is recorded.
  • Client first-frame-decoded is recorded only for a decoded PTY frame. first-screen-rendered follows an actual nonzero native screen draw and successful synchronized frame completion, not server first-byte timing.
  • Server phase DEBUG events go to daemon stderr/journal (standard user unit smalltalk.service). Enable module DEBUG filters via the managed daemon's RUST_LOG as documented; no service is restarted here. Existing OTEL request spans use service.name st-daemon; the INFO+ OTEL log filter does not export DEBUG stderr events. Client JSONL service fractal-tui is not an implied OTEL exporter.

Not fixed here

The intermittent first-open failure remains open. A server capability-issuance POST took17.7s while replication held the writer; its actual writer-acquire wait is NO DATA, not a proven cause. Related independent writer attribution/fairness work: #6323. The observed3081ms admission loan is already background and is not fixed there.

Verification

Final signed head ff3c88090e6: one queued gate-slot ticket runs cargo test and clippy for fractal-tui, fractal-api-client-v0, fractal-api-core and fractal-peer. Results pending, no pass claimed. Earlier2360785 and b2e3046 tickets were withdrawn while queued: payloads NOT RUN; b2 withdrawal exit94. Tests cover phase classification/bounds/cleanup, deadline expiry in each phase, selection abort, terminal deduplication, interleaved correlation, fragmented protocol decoding and post-flush screen presentation. Real Mac first-open proof with zero provider input and captured failing-stage proof are NOT RUN here and remain coordinator-arranged before GO. No daemon restart or live provider PTY input was sent; no CI dispatch requested.

Complexity and concerns

Existing retry, incarnation and single-flight mechanics are retained. The attempt tracker extends through native presentation so cancellation cannot lose the last phase. Detailed sink writes are bounded best-effort on contention, full cap or I/O errors; default terminal failure retention remains available.

Follow-ups

Private generated client boundaries are not separable without codegen: endpoint resolution, connect, upgrade and first binary arrival remain for the next coordinated regeneration. If evidence confirms upgrade/owner-open as the cause, a bounded cancellation/remote-cleanup acknowledgment design is required before one safe retry; dropping the upgrade does not await server-handler cleanup. No cancellation protocol or generated-client changes are included here.

Posted on behalf of @schickling
field value
agent_identity unknown
session unknown
agent_persona unknown
agent_supervisor unavailable
agent_tool unknown
agent_tool_version unknown
agent_runtime unknown
agent_model unknown
worktree fractal/2026-11-10-raw-attach-phases

@schickling-assistant

Copy link
Copy Markdown
Contributor Author

Superseded-head acceptance receipt (2360785ca40e1232dd6aff0fdc5c61f9e8340475): NOT RUN. The single ticket remained queued and was cleanly withdrawn by its owner before payload execution after additional diagnostic revisions were requested. No test or clippy payload exit codes exist. The outer logging pipeline did not preserve gate-slot's withdrawal exit status, so no numeric gate exit is claimed. A new ticket will run once at the revised final head. No checks were rerun and no success is claimed.

Posted on behalf of @schickling
field value
agent_identity unknown
session unknown
agent_persona unknown
agent_supervisor unavailable
agent_tool unknown
agent_tool_version unknown
agent_runtime unknown
agent_model unknown
worktree fractal/2026-11-10-raw-attach-phases

@schickling-assistant

Copy link
Copy Markdown
Contributor Author

Superseded head b2e3046 ticket: withdrawn while queued before payload execution. Gate exit94; cargo test and clippy NOT RUN. The final reviewed head ff3c880 now has its single acceptance ticket queued; no success claimed.

Posted on behalf of @schickling
field value
agent_identity unknown
session unknown
agent_persona unknown
agent_supervisor unavailable
agent_tool unknown
agent_tool_version unknown
agent_runtime unknown
agent_model unknown
worktree fractal/2026-11-10-raw-attach-phases

This branch has not been deployed

No deployments
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