fix(daemon): un-pinned @mention wakes respect the agent's pinned cwd - #485
Open
ChenNima wants to merge 1 commit into
Open
fix(daemon): un-pinned @mention wakes respect the agent's pinned cwd#485ChenNima wants to merge 1 commit into
ChenNima wants to merge 1 commit into
Conversation
Bring the un-pinned `mentioned` wake onto the same residual cwd-resolution ladder as `task_assigned`: add RESIDUAL_CWD_UPGRADE_TRIGGERS (the autonomous idea-anchored family plus `mentioned`) and gate the step-4 idea-session-origin upgrade and step-4a agent-owner project-pin fallback on it. The additions fire only on the residual online_first case — mention.service already pre-resolves explicit / direct-idea-instance / mentioner-owner pins at creation time — so an un-pinned @mention (incl. an agent->agent return-@mention) lands where that idea's conversation lives or on the target agent's owner-pinned cwd instead of a random online cwd. human_instruction / resource_resumed stay excluded; explicit-pin mentions still short-circuit as HARD pins. Idea e40f2b2c (Chorus 0.16.1). Confined to notification-turn.ts; no schema, migration, permission, endpoint, or new transport. 202 wake-service tests green, tsc clean. Live Codex e2e (task 3) handed to human (needs merge+deploy). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Brings the un-pinned
mentionedwake onto the same residual cwd-resolution ladder astask_assignedso an@mentionof an agent lands where that idea's conversation already lives, or on the target agent's owner-pinned project cwd — instead of a random online cwd. This also fixes agent→agent return-wakes (agent B@mentions the assigner A on completion), which ride the same path.Idea
e40f2b2c(Chorus 0.16.1), proposal972f919f. Research + fix, driven via the AI-DLC pipeline.Audit finding (corrected the proposal's premise)
An un-pinned
@mentionwas not raw online-first:mention.servicealready pre-resolves, at notification-creation time, the direct-idea instance pin and the mentioner-owner's project-fixed cwd (threaded as HARD pins). The genuine residual gaps were the idea session-origin upgrade formentionedand a target-agent-owner project-pin fallback. The fix is therefore purely additive — it fires only when selection would otherwise beonline_first.Implementation
Adds
RESIDUAL_CWD_UPGRADE_TRIGGERS(=IDEA_SESSION_ORIGIN_UPGRADE_TRIGGERS ∪ {"mentioned"}) and switches the step-4 (idea session-origin upgrade) and step-4a (agent-owner project-pin fallback) gates to it.human_instruction/resource_resumedremain excluded; explicit-pin mentions still short-circuit as HARD pins. No schema, migration, permission bit, endpoint, or new transport.Changed files
src/services/notification-turn.tsRESIDUAL_CWD_UPGRADE_TRIGGERS+ both upgrade gates use itsrc/services/__tests__/notification-turn.test.tsopenspec/changes/mention-wake-respect-pinned-cwd/**Test plan
pnpm testwake-service suites (notification-turn/listener/service): 202 passednpx tsc --noEmit: cleanNote: full-suite
cli/__tests__/daemon-*.test.mjsfailures are pre-existing (reproduce on base with this change stashed); this change touches 0cli/files. The OpenSpec change is intentionally left un-archived until task 3 is verified.🤖 Generated with Claude Code