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(clients): a thread left running a dev server alerts as completed by juliusmarminge · Pull Request #14213 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 29, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Closes #13965.

If a Claude turn ends with the agent leaving a dev server running, the desktop and web completion alert (sound, toast, notification) never fires, because the thread reads as Waiting for as long as the shell lives. The mobile push says "Agent finished" right away, even when the pending work is a subagent or monitor that will wake the agent. That second behavior is #13625.

What changed

One rule decides it, based on the typed OrchestrationV2PendingBackgroundTask.kind. It never matches labels or task-type strings. The rule is backgroundWorkHoldsCompletion in packages/shared/src/orchestrationV2PendingBackgroundWork.ts. It lives in shared rather than client-runtime because the server builds the push and does not depend on client-runtime:

  • command (dev servers, long-lived shells): does not hold. The turn counts as finished.
  • subagent, monitor: hold, because they wake the agent and it continues.
  • background_task (opaque work, and what an unknown or missing kind decodes to): holds. This is the conservative choice.

Both surfaces call it:

  • Desktop/web: ThreadNotificationCoordinator records a completion when the thread is ready, or when it is waiting and the pending work does not hold completion.
  • Mobile push: projectThreadAwarenessV2, which the server relay publishes and the relay turns into the push, reports a completed run as running while held work is pending. AgentAwarenessRelay now also republishes on subagent.updated and provider-thread.updated, so a held completion goes out when that work ends. Before this, neither event triggered a publish, so nothing could release the hold.

The sidebar and the mobile list still show Waiting while a dev server runs. This PR only changes when the alert fires.

Also: the relay republishes on turn-item.updated when a background item type (command, dynamic tool, subagent) is no longer active (turnItemUpdateCanEndBackgroundWork, next to BACKGROUND_TURN_ITEM_TYPES); streaming output does not trigger a shell read.

Verification

  • packages/shared: vp test run src/orchestrationV2PendingBackgroundWork.test.ts src/agentAwareness.test.ts: 35 passed. The rule table covers none, command-only, two commands, subagent, monitor, command+monitor, command+subagent, and background_task/unknown.
  • apps/web: vp test run src/components/ThreadNotificationCoordinator.test.tsx src/components/ThreadNotificationCoordinator.badge.test.tsx: 33 passed. The new case: no alert while a monitor is pending, then one "Thread completed" alert once only a command remains.
  • apps/server: vp test run src/relay/AgentAwarenessRelay.test.ts: 21 passed.
  • apps/server: vp test run src/orchestration-v2/ProjectionStore.test.ts: the new case "dates a completion released by held background work at the release" runs the real SQL shell read. The run completes, a monitor stays pending (push phase running), and the monitor ends 5 minutes later through provider-thread.updated. The push is then completed with updatedAt equal to the release time, so the relay's 2-minute freshness check (infra/relay/src/agentActivity/agentActivityAlerts.ts) keeps it. This already holds, because the store bumps the thread's updatedAt on every run, turn-item, subagent and provider-thread event. The test pins it: dropping that bump makes the test fail with the run's time.
  • apps/server: vp test run src/relay/AgentAwarenessRelay.test.ts: 22 passed. The new case "publishes a held completion when its background item ends, not on tool output" drives the relay's real event stream over the in-memory projection store. The run completes with a background dynamic_tool still running, and the push is running. Streaming assistant output and a running tool tick do not read the shell. The tool's terminal turn-item.updated publishes completed. It fails with the old filter (['running'], no completion) and with an unfiltered one (extra shell reads, 6 instead of 4). packages/shared adds a table for the turn-item predicate.
  • Before/after: with the source changes reverted, the new awareness cases (monitor, command+subagent), the new coordinator case, and the relay event-filter case all fail. With the fix they pass.
  • tsc --noEmit for shared, web, server, and mobile: clean. vp lint on the 8 touched files: clean. vp run knip:check: clean.
  • Not run: replay fixtures or a live provider run. The change is pure client and relay logic over the shell's pendingBackgroundTasks, which already carries kinds.

Model: Claude Opus 5.5 (Claude Code)

🤖 Generated with Claude Code


Devin Review

Sorry, something went wrong.

Uh oh!

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

All reactions
@juliusmarminge @claude
fix(clients): a thread left running a dev server alerts as completed
e3abfff
The completion alert and the mobile push now follow one rule, decided by
the typed kind of the background work a completed root run leaves behind.
Commands, such as dev servers and long-lived shells, do not hold the
alert. Subagents and monitors do, because they wake the agent (#13625).
Work the adapter cannot name, including unknown kinds, holds.

The rule is backgroundWorkHoldsCompletion in the shared pending-work
module. The web/desktop notification coordinator and the relay awareness
projection that feeds the mobile push both call it. The relay also
republishes on subagent and provider-thread updates, so a held
completion is sent when that work ends.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 29, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Sep 29, 2026
View reviewed changes
Comment thread apps/server/src/relay/AgentAwarenessRelay.ts Resolved

Uh oh!

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

@macroscopeapp

macroscopeapp Bot commented Sep 29, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 50d531b

Macroscope's review found this PR approvable — This focused fix adjusts completion alerts based on the existing background-work kind, distinguishing long-running commands from work that can wake the agent. Web, relay, awareness, and projection behavior are covered by targeted tests, with no schema or production-infrastructure changes.

You can add or adjust custom eligibility rules. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Sep 29, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.1 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 1 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 50d531b · 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: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

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

All reactions

Sorry, something went wrong.

Uh oh!

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

juliusmarminge and others added 2 commits September 28, 2026 21:43
@juliusmarminge @claude
test(server): a completion released late by background work stays fre…
ae9a0d1
…sh for the push

The relay drops a completed push whose updatedAt is over two minutes old.
Pin that a monitor ending five minutes after the root run releases the
completion with the release time: the shell's updatedAt follows the
provider-thread.updated that clears the roster.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@juliusmarminge @claude
fix(server): the push completes when a held background item ends
50d531b
Pending background work also counts active command, dynamic tool, and
subagent turn items. When one ends after the root run completed, only
turn-item.updated fires, which the relay ignored, so the push stayed
"running". The relay now republishes on turn-item updates that can end
background work: a background item type that is no longer active, per a
shared predicate next to BACKGROUND_TURN_ITEM_TYPES. Streaming output on
running items and every other item type still skip the shell read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
macroscopeapp[bot]
macroscopeapp Bot approved these changes Sep 29, 2026
View reviewed changes
@juliusmarminge
juliusmarminge merged commit 82f884d into t3code/codex-turn-mapping Sep 30, 2026
24 of 25 checks passed

Uh oh!

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

@juliusmarminge
juliusmarminge deleted the v2/gi-13965-alert-by-work-kind branch September 30, 2026 04:48
This was referenced Sep 30, 2026
[Bug]: A thread whose agent leaves a dev server running stays "Monitoring" on desktop with no completion alert, while mobile reports it completed #13965
Closed
fix(web): show a thread's completion when a watch loop is still live #7655
Closed
@vanderlindenma vanderlindenma mentioned this pull request Oct 2, 2026
[Bug]: Sidebar hides a finished thread's unseen completion while a background shell it left running is still alive #14872
Closed
2 tasks done
@Mnigos Mnigos mentioned this pull request Oct 2, 2026
fix(web): a thread that left a shell running shows its unseen completion #14910
Merged
@f4llenz f4llenz mentioned this pull request Oct 3, 2026
[Bug]: A Claude thread waiting on a background command sends a false "Thread completed" alert #15099
Closed
2 tasks done
@t3dotgg t3dotgg mentioned this pull request Oct 3, 2026
fix(clients): a dev server left running no longer says the thread is waiting #15114
Merged
@Vantrongs Vantrongs mentioned this pull request Oct 3, 2026
[Bug]: A thread whose agent left a dev server running stays "Waiting" in the sidebar after the completion alert, and never shows "Completed" #15246
Closed
2 tasks done
@t3dotgg t3dotgg mentioned this pull request Oct 3, 2026
feat: Wait keeps a thread working until its background command ends #15315
Closed
@dominic-r dominic-r mentioned this pull request Oct 9, 2026
[Bug]: Thread auto-settles while the agent is still waiting on a background command #17625
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

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

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