GeezerVison is showing github.com — fix(server): settled threads no longer send mobile completion pushes by Dodhon · Pull Request #40391 · pingdotgg/t3code
Conversation
Problem
When a thread settles right as its run finishes—for example, when an agent self-settles at turn end (t3_thread_organize settle via ThreadManagementService.settleAfterRun), when auto-settle on PR merge triggers, or when the user settles within 5 seconds of completion—mobile still receives an "Agent finished" push notification.
projectThreadAwarenessV2 already suppresses "completed" when settledOverride === "settled", but AgentAwarenessRelay kept a heldCompletions set (added in #24769) that explicitly stripped settledOverride: null when the 5-second completion confirmation expired, force-publishing phase: "completed" to the push relay and then clearing the card 5 seconds later.
Expected: a thread that settles during the 5-second completion confirmation window should clear its live activity (null) without publishing "completed" to mobile push.
Change
- Removed
heldCompletions and the settledOverride: null re-projection override in apps/server/src/relay/AgentAwarenessRelay.ts.
AgentAwarenessRelay now follows projectThreadAwarenessV2: if a thread settles during the 5-second confirmation window (or before a failed completion publish retries), the relay publishes null to clear any live activity card (or skips publishing if the thread was already cleared) instead of sending a "completed" push.
- Unsettled completions, continuation gaps, failures, waiting-for-approval/input alerts, and settled threads with active awaited background work behave unchanged.
- Updated the 3 settled-during-hold unit tests in
apps/server/src/relay/AgentAwarenessRelay.test.ts to assert clearing without "completed".
Scope
Small bug fix for an obvious bug in one server module (apps/server/src/relay/AgentAwarenessRelay.ts) and its unit test file (apps/server/src/relay/AgentAwarenessRelay.test.ts); net reduction of 40 lines in production code, no new settings or contract changes.
Verification
Focused tests
Updated tests in apps/server/src/relay/AgentAwarenessRelay.test.ts failed on main (dd941b9c3b58) before the fix:
clears instead of alerting when the thread settles during the completion hold: expected [ 'running', 'completed' ] to deeply equal [ 'running', null ]
does not alert when a completion settles during its hold after an earlier tombstone: expected [ null, 'completed', null ] to deeply equal [ null ]
clears instead of retrying a failed completion after the thread settles: expected [ 'running', 'completed', 'completed' ] to deeply equal [ 'running', 'completed', null ]
After the fix:
vp test run apps/server/src/relay/AgentAwarenessRelay.test.ts: 23/23 passed.
vp run check:changed: passed (format, lint 0 warnings/errors, knip 2/2, graphql, typecheck 3 packages, test 25/25 across affected files).
Live server runtime transcript
Ran the real server (apps/server/src/bin.ts serve, isolated fresh --base-dir, T3CODE_DEV_SEED=0) pointed at a local HTTP stub relay, ran a real Replay (dev) (multi-turn) turn, immediately dispatched thread.settle once the run completed (inside the 5s hold), and waited 11.5s across two confirmation windows:
| Target |
Relay phases published |
origin/main (dd941b9c3b58) |
["starting", "running", "completed", null] |
This PR (c50c79cad2) |
["starting", "running", null] |
Transcript (before vs after)
=== BEFORE (origin/main dd941b9c3b58) ===
[before] Dispatching Replay (dev) turn...
[before] STUB RECEIVED: phase="starting" at 2026-11-21T15:28:28.824Z
[before] STUB RECEIVED: phase="running" at 2026-11-21T15:28:29.234Z
[before] Run completed (run:thread:thread%3Averify-relay:ordinal:1); settling immediately (within 5s hold)...
[before] Waiting 11.5s across two confirmation windows...
[before] STUB RECEIVED: phase="completed" at 2026-11-21T15:28:34.686Z
[before] STUB RECEIVED: phase=null at 2026-11-21T15:28:39.721Z
[before] SUMMARY phases: ["starting","running","completed",null]
=== AFTER (fix c50c79cad2) ===
[after] Dispatching Replay (dev) turn...
[after] STUB RECEIVED: phase="starting" at 2026-11-21T15:23:01.516Z
[after] STUB RECEIVED: phase="running" at 2026-11-21T15:23:01.738Z
[after] Run completed (run:thread:thread%3Averify-relay:ordinal:1); settling immediately (within 5s hold)...
[after] Waiting 11.5s across two confirmation windows...
[after] STUB RECEIVED: phase=null at 2026-11-21T15:23:07.047Z
[after] SUMMARY phases: ["starting","running",null]
Not checked
- End-to-end delivery to a real iOS/Android device via T3 Connect (tested up to the payloads the server publishes to the relay).
- Web/desktop client notifications (
ThreadNotificationCoordinator.tsx), which do not use AgentAwarenessRelay and are out of scope for this change.
Created with Gemini 4 Neon in T3 Code (Antigravity harness).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-21T15:32:05.376999Z |
c50c79c |
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The relay removes held-completion tracking. When a thread settles during a confirmation hold, the relay no longer publishes the held completion. Updated tests cover tombstone publication, an existing tombstone, and a failed completion retry.
Changes: Completion Hold Behavior
| Layer / File(s) |
Summary |
Relay handling and tests apps/server/src/relay/AgentAwarenessRelay.ts, apps/server/src/relay/AgentAwarenessRelay.test.ts |
The relay removes held-completion state and no longer publishes a completion for a thread that settles during a confirmation hold. Tests now expect a tombstone or no additional publication in the covered cases. |
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Bug fix
Possibly related PRs
Suggested reviewers: juliusmarminge, maximkes, macroscopeapp
Merge Risk: Minimal · up to c50c7
-
Threads that settle during the completion confirmation window no longer send a mobile completion push. Unsettled completions and alerts are described as unchanged, and the updated tests cover the new settled-during-hold behavior. The remaining risk is a narrow edge case after an uncertain publish failure, so the change looks safe to merge.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title states the main change: settled threads no longer trigger mobile completion pushes. It follows the conventional commit format and matches the removal of heldCompletions and the settledOverri… |
| Description check |
 |
The description covers the problem, the change, scope, and verification. It follows the template sections with specific details: failing test names before the fix, passing results after, a live runtim… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title states the main change: settled threads no longer trigger mobile completion pushes. It follows the conventional commit format and matches the removal of heldCompletions and the settledOverride null re-projection in AgentAwarenessRelay, as described in the summary and objectives.
Full details: Description check
-
Explanation
The description covers the problem, the change, scope, and verification. It follows the template sections with specific details: failing test names before the fix, passing results after, a live runtime transcript comparing main and the PR, and a list of items not checked. The Problem section explains the bug and expected behavior. The Scope section names the affected files and says why no issue link is included (small obvious bug). It does not link an issue. It does state the reason, which the template asks for. The template also asks for the model and harness used, and the author includes 'Created with Gemini 4 Neon in T3 Code (Antigravity harness)'.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between b427708 and c50c79c.
Files selected for processing: 2
-
apps/server/src/relay/AgentAwarenessRelay.test.ts
apps/server/src/relay/AgentAwarenessRelay.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
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:unvouched
Author is not yet trusted in the VOUCHED list.
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.
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.
|