Skip to content

[Bug]: Fresh-session scheduled runs in a thread the user also chats in move the conversation to a context-free session #36087

Closed

Description

@Motaghi

Before submitting

Area

Server, scheduled tasks

Steps to reproduce

  1. In an existing Claude thread with a long conversation, create a schedule bound to that thread with freshSession: true (for example interval, every 30 minutes).
  2. Let one scheduled run happen.
  3. Send a normal message in the thread.

Expected behavior

The user's conversation continues in its own session, and the scheduled run gets fresh context for its own message only. Alternatively, schedule_task warns or refuses when a fresh-session schedule is bound to a thread that has user messages, and the docs say the thread will move to the new session.

Actual behavior

Each scheduled run creates a new provider thread, and ProjectionStore sets the thread's activeProviderThreadId to it. The user's next message goes to the newest session, which has no context. It answered a catch-up request by saying its only job was the scheduled check. Meanwhile, delegated-task continuations kept going to the old session, so the thread effectively had two sessions answering in turn. One thread had about 20 Claude sessions in 20 hours.

Impact

The thread loses its working context without warning, and replies contradict the visible history. In the provider event log the session switches with every run. Combined with #20339, a wake continuation can also land on the wrong provider thread.

Version or commit

0.1.9 (desktop service). Code references from main at f939f66705: ScheduledTaskService.ts sends bound fresh-session runs with freshContext: true, and ProjectionStore.ts overwrites active_provider_thread_id on each provider-thread update.

Environment

macOS, Claude CLI driven by claudeAgent through a pool provider instance, full-access thread.

Investigated with AI assistance (Claude and Codex); I checked the evidence and the code references myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions