Skip to content

(CODUX-219) Bind agent wakeups to originating threads - #3019

Merged
numnx merged 1 commit into
feature/CODUX-219-fix-chat-continuations-and-tts-playbackfrom
task/feature-codux-21-t01-codex-a8c04fbf-mrjh2k1t
Jul 13, 2026
Merged

(CODUX-219) Bind agent wakeups to originating threads#3019
numnx merged 1 commit into
feature/CODUX-219-fix-chat-continuations-and-tts-playbackfrom
task/feature-codux-21-t01-codex-a8c04fbf-mrjh2k1t

Conversation

@numnx

@numnx numnx commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Bind agent wakeups to originating threads

Automated task PR opened by Code UX for T01.

📋 Summary

Sprint: Sprint 219 · Fix chat continuations and TTS playback · Task: T01

Keep agent-owned Project Manager continuations bound to their originating chat thread without cancellation cascades or duplicate turns, and deliver long Chat replies through a fast, sentence-chunked, ordered TTS pipeline.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.6-sol

⏱️ Timing

Started 2026-07-13 17:04:21 UTC
Finished 2026-07-13 17:11:00 UTC
Duration 6m 38s

📊 Token Usage

Metric Value
Input tokens 141,823
Cached input tokens 2,621,440
Output tokens 14,027
Total tokens 2,777,290
Invocations 1
Tool calls 31
Active time 5m 58s

Included usage estimate (subscription/local login): $2.44

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Ensure Project Manager wakeups created through `scheduler_code_ux` continue in the originating dashboard thread whenever MCP context provides one, instead of silently creating a new thread.

## Scope
- `src/mcp/management/agent-scheduler-actions.ts`
- `src/server/mcp-agent-context.ts`
- `tests/backend/mcp/management-scheduler-actions.test.ts`
- `docs/dashboard/scheduler.md`
- `docs/mcp/tools-and-contracts.md`
- Mirrored public scheduler and MCP pages under `docs-web/user/dashboard/scheduler.md`, `docs-web/content/docs/user-dashboard-scheduler.mdx`, `docs-web/content/docs/developer-mcp-tools.mdx`, and `docs-web/developer/mcp-tools.md`

## Implementation Requirements
1. Read `getCurrentMcpThreadId()` when handling `schedule_wakeup` and use it as the default target when the caller omits or sends an empty/null thread id; preserve an explicit non-empty thread id when supplied.
2. Keep the existing `agent_scheduler` provenance, authenticated agent ownership, project isolation, optional connection behavior, timing-mode validation, and cancellation authorization unchanged.
3. Add regression coverage for contextual defaulting, explicit thread override, standalone MCP calls without thread context, and persistence of the resolved target in the scheduler payload; update canonical and public documentation to describe the default.

## Constraints
- Do not broaden `scheduler_code_ux` into the administrative `manage_scheduler` surface.
- Do not change existing `SprintActions` planning-wakeup behavior except where shared context semantics require consistency.
- Never allow a contextual fallback to bypass project/thread ownership validation or expose real project names in documentation.

## Verification
- Run `pnpm exec vitest run tests/backend/mcp/management-scheduler-actions.test.ts tests/backend/mcp/management-sprint-actions.test.ts`.
- Run `pnpm run lint`.
- Run `pnpm run check:docs-web` and confirm contextual wakeups resolve to the originating thread while standalone calls remain threadless.
🌿 Branch Info

Base: feature/CODUX-219-fix-chat-continuations-and-tts-playback
Head: task/feature-codux-21-t01-codex-a8c04fbf-mrjh2k1t


🤖 Generated by Code UX

@numnx
numnx merged commit 48ecd28 into feature/CODUX-219-fix-chat-continuations-and-tts-playback Jul 13, 2026
20 checks passed
@numnx
numnx deleted the task/feature-codux-21-t01-codex-a8c04fbf-mrjh2k1t branch July 13, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant