Skip to content

fix(server): keep OpenCode approvals, progress, and Stop responsive - #283

Merged
rynfar merged 4 commits into
pylonfrom
upstream/2026-09-04-opencode-approvals
Sep 6, 2026
Merged

fix(server): keep OpenCode approvals, progress, and Stop responsive#283
rynfar merged 4 commits into
pylonfrom
upstream/2026-09-04-opencode-approvals

Conversation

@rynfar

@rynfar rynfar commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

OpenCode can appear stuck when its output pipes fill, an approval has no usable controls, or Stop finishes before delegated sessions stop. Lost reply events and disconnects can also leave approvals and running indicators stale.

Finish the previously started adoption of upstream #9005, #9282, and #9653. Keep output pipes drained, make permission replies bounded and retryable, keep automatic replies off the event pump, reconcile missing requests after reconnect, and wait for child cleanup on Stop. Native task progress updates only an active parent turn; duplicate plans are suppressed and cancelled tasks are omitted, completing the intent of #178.

Preserve Pylon's session-incarnation and turn-admission guards, compaction events, approval contracts, branding, and other providers. Explain OpenCode's workspace-wide permission scope through the existing detail field so web, desktop, and mobile all display it. Shared projection fixes restore failed approvals and finalize aborted text; local, external-server, remote, and tunnel connections use the same behavior.

Validation: all 400 focused tests across nine adapter, runtime, orchestration, web, mobile, and shared presentation files pass (including a real subprocess writing 2 MiB to each output pipe). Server, web, mobile, and client-runtime typechecks pass; targeted lint, formatting, and diff checks pass. No live provider session or production database was changed. Browser verification has not been run.

Implemented with GPT-6 Astra through the Codex harness, completing the earlier port and incorporating the task-progress work authored with Claude Opus 5 in Pylon.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

t3dotgg and others added 4 commits September 5, 2026 22:07
(cherry picked from commit 62d39bf00d5ddd83a9b36a81321fe9aa4d2502bb)
… (#9282)

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit d2b6f3b9296f682c6158b894ab33d98d0c4bfb2b)
OpenCode could show an Approval badge with no controls, appear stuck on TodoWrite, and keep showing a running turn after Stop.

- Show every permission, including old saved requests. Keep failed replies retryable and close completed requests even when reply events are lost.
- Keep OpenCode output pipes drained and automatic replies out of the event loop. Handle disconnects, reconnects, and confirmed stops without stale requests or running states.
- Show native task progress and command results. Do not treat TodoWrite or approval history as file edits or executed commands.
- Ignore late aborts and task updates after a turn finishes.

Fixes #4795
Fixes #7113
Fixes #5760

Created with GPT-6 Astra (preview) in Codex. Reviewed and merged with Claude Fable 5.1 in Claude Code.

(cherry picked from commit 01f3e50eca5102ccd881de6f942a98fe6a518ad4)
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.6 KiB −2 B (−0.0%) 15.1 KiB
Codex Thread snapshot wire 7.1 KiB 7.1 KiB +2 B (+0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.6 KiB 6.6 KiB −4 B (−0.1%) 7.8 KiB
Codex Live turn WebSocket decoded 56.5 KiB 56.5 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 8 8 0 (0.0%) 21
Claude Total thread wire 13.6 KiB 13.6 KiB 0 B (0.0%) 15.1 KiB
Claude Thread snapshot wire 7.1 KiB 7.1 KiB −6 B (−0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.6 KiB +6 B (+0.1%) 7.8 KiB
Claude Live turn WebSocket decoded 57.3 KiB 57.3 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 8 8 0 (0.0%) 21

Baseline: 9afb259 · PR result: 7d4c455 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 111.2 KiB
  • Claude decoded thread snapshot: 111.9 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@rynfar
rynfar merged commit fa6da65 into pylon Sep 6, 2026
17 checks passed
@rynfar
rynfar deleted the upstream/2026-09-04-opencode-approvals branch September 6, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants