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 — fix(core): record user stops without waking idle sessions by kitlangton · Pull Request #46439 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 31, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Why

Stopping a background shell with Ctrl+D was reported as a shell failure, which woke the idle agent and could prompt it to investigate or restart a process the user intentionally stopped. Subagent interruption also lost the distinction between a user stop and generic cancellation.

What Changes

Action Result
Stop a background shell or subagent Show stopped by user, record the notice, and leave an idle parent asleep.
Stop a foreground shell or subagent Return an intentional cancellation result instead of a tool failure.
Stop a user-entered ! shell command Preserve the same user intent in its completion notice.
Continue the parent later Deliver the recorded notice with an instruction not to restart unless asked.

The explicit user-stop reason survives background-job recovery. Live and recovered notices use the existing admit-without-wake path; the TUI already displays pending synthetic messages, so no new delivery mechanism is needed.

Stop intent also survives event replay and stopping before a result waiter is attached. Quiet stop notices no longer keep the tab's busy indicator running; real execution and pending prompts still do.

Demo

comparison-clean.mp4

Matched production-TUI recordings at base 5894e46688 and recorded change 961fb3918d, using the same real shell command and Ctrl+D interaction. Model responses are simulated. The before clip shows the failure notice and unsolicited follow-up; the after clip shows the intentional stop with the parent and its tab remaining idle. Both captures use the same viewport, are identically cropped for readability, and run at normal speed. The run records two model requests after versus three before. The change was subsequently rebased onto 3e9b009642, with test fixtures adapted to the new upstream layer-graph API.

Scope

This changes intentional user stops for shells and subagents, including their TUI presentation and replay behavior. Generic cancellation, failure, and server-shutdown recovery keep their existing execution and notification policies.

The rebase also updates the execution and Session-instance HTTP test fixtures to the upstream layer-graph replacement API so they continue to compile and run.

Verification

# packages/core
bun run test test/session-shell.test.ts test/session-projector.test.ts test/session-message-update.test.ts test/job.test.ts test/session-execution.test.ts test/tool-subagent.test.ts
bun run test test/tool-shell.test.ts --test-name-pattern 'intentional stop|user stop|initial progress|finishes before backgrounding'
bun typecheck

# packages/client
bun run test test/solid-data.test.ts
bun typecheck

# packages/server
bun run test test/fetch.test.ts
bun run test test/session-instances.test.ts
bun typecheck

# packages/tui
bun run test test/context/session-tabs.test.tsx test/component/session-tabs-status.test.tsx test/session-user-stop.test.tsx
bun typecheck

Focused checks pass. Regression coverage includes idle-parent no-wake behavior, later notice delivery, durable event replay, stopping before result observation, interruption during initial progress, generic cancellation preservation, and light/dark TUI rendering. Real Ctrl+D flows were also exercised for tool shells, user-entered ! shells, and subagents, with wide and narrow shell layouts.

The unmodified pre-push hook also passed all 33 repository typecheck tasks.

The broader shell suite intermittently loses output from short-lived commands. The same failures were reproduced twice in an untouched worktree at the base revision; they are not fixed by this PR.

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions github-actions Bot added the contributor label Aug 31, 2026
@kitlangton
kitlangton force-pushed the user-stop branch from f87ae35 to 0d9ecd9 Compare August 31, 2026 17:30
kitlangton added 4 commits August 31, 2026 13:50
@kitlangton
fix(core): record user stops without waking idle sessions
0a0cf94
@kitlangton
fix(core): preserve stopped shell outcomes through replay
fc1c91d
@kitlangton
test(core): adapt execution fixture to layer graph API
faa5c18
@kitlangton
test(server): migrate instance fixture layer replacements
79e49a7
@kitlangton
kitlangton force-pushed the user-stop branch from 961fb39 to 79e49a7 Compare August 31, 2026 17:54
@kitlangton

kitlangton commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing this in favor of a different approach. Reviewing the diff made it clear that the user-stop reason had to be written into two places (the Job and the Shell) and kept in sync, and there is still a window between shell creation and job registration where they diverge. The cleaner fix is for Job to carry the producer's typed terminal outcome instead of classifying fiber exits into its own status, which removes the sync problem entirely. A replacement PR with that change is coming.

All reactions

Sorry, something went wrong.

Uh oh!

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

@kitlangton kitlangton closed this Sep 2, 2026
@kitlangton kitlangton mentioned this pull request Sep 2, 2026
refactor(core): carry typed job outcomes for stops #46721
Closed
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

No one assigned

Labels

contributor

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

@kitlangton
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.