Skip to content

(CODUX-183) Add wakeup scheduler contracts - #2658

Merged
numnx merged 1 commit into
feature/CODUX-183-scheduler-wakeups-and-guidancefrom
task/feature-codux-183-scheduler-wakeups-and-guidance-t02-codex-mraopwxk
Jul 7, 2026
Merged

(CODUX-183) Add wakeup scheduler contracts#2658
numnx merged 1 commit into
feature/CODUX-183-scheduler-wakeups-and-guidancefrom
task/feature-codux-183-scheduler-wakeups-and-guidance-t02-codex-mraopwxk

Conversation

@numnx

@numnx numnx commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Add wakeup scheduler contracts

Automated task PR opened by Code UX for T02.

📋 Summary

Sprint: Sprint 183 · Scheduler Wakeups and Guidance · Task: T02

Extend scheduler wakeups so project-manager chat workers can schedule delayed follow-up messages that fire only after the originating invocation has completed, and update project-manager guidance to use that capability for sensible delayed follow-ups.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-07 13:28:32 UTC
Finished 2026-07-07 13:39:25 UTC
Duration 10m 52s

📊 Token Usage

Metric Value
Input tokens 169,389
Cached input tokens 4,920,704
Output tokens 23,118
Total tokens 5,113,211
Invocations 1
Tool calls 76
Active time 10m 8s

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

✅ 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
Introduce a first-class scheduler wakeup target and `manage_scheduler` action that creates a one-time delayed chat follow-up, optionally gated on the current MCP invocation context.

## Scope
- src/contracts/scheduler-types.ts
- src/contracts/internal-management-types.ts
- src/contracts/mcp-tool-definitions.ts
- src/mcp/management/scheduler-actions.ts
- src/repositories/scheduler-repository.ts
- tests/backend/mcp/management-scheduler-actions.test.ts
- tests/backend/repositories/scheduler-repository.test.ts

## Implementation Requirements
1. Extend `ScheduleTargetType` with `wakeup` and add a `ScheduleWakeupTarget` containing `bodyMarkdown`, optional `threadId`, optional `title`, optional `connectionId`, optional `sourceInvocationId`, and optional `resumeAfterInvocationCompletion` boolean.
2. Add `wakeupTarget` to `SchedulerEntryRecord`, create/update input types, and repository target JSON mapping without adding a database migration.
3. Add `schedule_wakeup` to `ManageSchedulerArgs`, `manage_scheduler` tool schema, action enum text, and scheduler action routing.
4. In `SchedulerActions`, normalize flattened fields for `schedule_wakeup`: require `projectId`, require `bodyMarkdown`, accept either `scheduledFor` or positive `delaySeconds`, derive `scheduledFor` from `Date.now() + delaySeconds * 1000`, and infer `targetType: "wakeup"`.
5. When `resumeAfterInvocationCompletion` is not explicitly false, attach `getCurrentMcpInvocationId()` as `wakeupTarget.sourceInvocationId` if present; also accept an explicit `sourceInvocationId` for tests and non-MCP callers.
6. Add tests for flattened `schedule_wakeup`, nested `wakeupTarget`, positive numeric-string `delaySeconds`, missing body validation, and persistence round-trip of `sourceInvocationId`.

## Constraints
- Do not change existing sprint, quicksprint, chat, or memory remediation payload normalization.
- Generic `create` should accept `targetType: "wakeup"` only when a valid `wakeupTarget` or flattened wakeup body is supplied.
- Keep recurring scheduler behavior available at the contract layer, but `schedule_wakeup` should default to one-time no-recurrence entries.
- Do not require a current invocation ID for explicit user-scheduled wakeups; wakeups without a source invocation should execute at their due time.

## Verification
- `pnpm exec vitest run tests/backend/mcp/management-scheduler-actions.test.ts tests/backend/repositories/scheduler-repository.test.ts`
- `pnpm run lint`
- Success means MCP can create wakeup entries with `delaySeconds`, repository rows round-trip `wakeupTarget`, and existing scheduler target tests still pass.
🌿 Branch Info

Base: feature/CODUX-183-scheduler-wakeups-and-guidance
Head: task/feature-codux-183-scheduler-wakeups-and-guidance-t02-codex-mraopwxk


🤖 Generated by Code UX

@numnx
numnx merged commit 88be4da into feature/CODUX-183-scheduler-wakeups-and-guidance Jul 7, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-183-scheduler-wakeups-and-guidance-t02-codex-mraopwxk branch July 7, 2026 13:42
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