Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate. Nearest: [Bug]: Fresh-session scheduled runs in a thread the user also chats in move the conversation to a context-free session #36087, fixed by fix(server): a fresh-session scheduled run no longer takes over the thread's conversation #36103 and included in v0.1.12. That fix keeps the user's messages on the thread's own session. This report is the other half: after a fresh-session scheduled run, delegated-task completion wakes go to the fresh session. Also related: [Bug]: After a fresh-context send, a background-task wake of the old Claude session routes the next message back to it #38764, the same split triggered by a fresh-context send instead of a schedule.
- I included enough detail to reproduce or investigate the problem.
Area
Server: scheduled tasks and orchestration wake routing (claudeAgent provider)
Version
T3 Code 0.1.12 (desktop, macOS), Claude provider.
Steps to reproduce
- In a long-running Claude thread that dispatches delegated tasks (
delegate_task, async), create a schedule bound to that thread withfreshSession: true, for exampleintervalevery 60 minutes. - While a few delegated tasks are still running, let one scheduled run happen. T3 starts a new Claude session for it, as documented.
- Let the delegated tasks finish. Their completion notifications ("Delegated task … finished") wake the thread.
- Send a normal message in the thread.
Expected behavior
The scheduled run gets fresh context for its own turn only. Everything else, including completion wakes and the user's messages, continues in the thread's own session.
Actual behavior
- After step 2, every delegated-task completion wake runs in the fresh session, which has no history beyond the scheduled prompt. In that session the agent goes on working: it dispatches follow-up tasks, accepts reviews and writes reports to the user, all without the thread's context.
- At step 4 the user's message goes to the original session (the fix(server): a fresh-session scheduled run no longer takes over the thread's conversation #36103 behaviour). That session has never seen the turns from step 3.
- The visible thread therefore interleaves two Claude sessions. The user sees the agent deny knowledge of the message it posted minutes earlier. In our case the agent was asked about numbers from its own previous message, replied "I don't see that in anything I've sent today", then guessed the context had been summarised away.
- With an hourly fresh-session schedule this recurs every hour. On one thread over ~23 hours, 11 of the hourly fresh sessions handled worker completions, the busiest absorbing 132 of them, before the user's next message moved the conversation back.
Evidence
Claude Code's per-session transcripts show it directly. The thread's main session file stops at the scheduled run. A new session file starts with the scheduled prompt, followed by every subsequent Delegated task … finished prompt. The user's next message appears in the main session file again, with its parentUuid pointing at the turn before the scheduled run.
Impact
High. An orchestrating agent makes real decisions (dispatch, review acceptance, merges) with no context, and the main session never learns about them. Users see an agent contradict or forget its own previous message. Nothing in the UI shows that a different session answered.
Workaround
Don't bind freshSession: true schedules to a thread you also chat in or that dispatches delegated tasks. Leave the schedule unbound (it gets its own thread), or turn freshSession off.
Suggested fix
Route completion wakes for tasks dispatched by the original session to that session, as #36103 does for user messages. Alternatively, have schedule_task refuse or warn when a fresh-session schedule is bound to a thread with user messages or running delegated tasks.
Activity
fix(server): delegated completions wake the session that dispatched t…
1kuna commentedon Nov 28, 2026
Thanks for fixing delegated-completion routing in #44637. There is a related way for a fresh scheduled turn to enter a conversation without anyone binding the schedule to that conversation.
This occurs before any delegated completion is routed. By the time the schedule fires, the destination can have become a human conversation even if it was dedicated to automation when the schedule was created. Checking the destination at firing time would cover that transition.