Skip to content

feat(runtime-host): bind ScheduledTasks to immutable Connection identity #3927

Description

@me2seeks

Parent tracker

Problem

ScheduledTask agent-run effects currently persist a model slug and model without immutable Connection identity. If account A is deleted and account B later reuses A's slug, a durable task can silently execute with B.

ScheduledTask is a separate durable aggregate and should not expand the Session identity PR.

Desired outcome

Persist and execute every new or replaced ScheduledTask agent-run target as exact connectionId + connectionSlug + model.

Acceptance criteria

  • New and replaced agent-run effects freeze the exact Connection ID, slug, and model.
  • Task idempotency fingerprints include Connection ID.
  • Execution revalidates ID+slug+model before allocating a Session, AgentRun, or provider effect.
  • Task-created Sessions receive the exact target.
  • Delete A/reuse slug B never dispatches B credentials or creates execution state for an A-bound task.
  • Legacy slug-only tasks remain readable and non-effect editable but fail closed before execution until explicitly recreated/reselected.
  • Core codec, workflow persistence, Runtime Host coordinator/protocol, idempotency, corruption, and real two-client race tests cover the invariant.
  • The closed ScheduledTask wire shape advances the compatibility epoch once from the then-current main value.

Non-goals

  • Session legacy adoption
  • CLI/Desktop account pickers
  • Onboarding or OAuth
  • Automatic account fallback

Generated-by: Codex

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