Skip to content

Smart mode: per-session context payloads #408

Description

@jamesrochabrun

Parent: #398

Depends on: Context Builder core selection and assembly model.

Goal

Let Smart-mode orchestration attach a distinct curated context payload to each planned worktree session instead of launching every agent with only a prompt string.

Implementation Notes

Target areas:

  • OrchestrationSession in WorktreeOrchestrationTool.swift
  • MultiSessionLaunchViewModel.launchOrchestrationSessions
  • Smart plan review UI in MultiSessionLaunchView

Extend OrchestrationSession with an optional contextSelection or equivalent Codable payload. During launch, assemble the context for each session and pass it through the contextBlock launch path introduced by the Context Builder core issue.

Keep the first version pragmatic:

  • allow empty context to preserve current behavior
  • support manual attachment/curation per session if the UI exists
  • otherwise support a simple default selection hook without blocking launch
  • show token estimate per session if token estimates are available

Acceptance Criteria

  • A Smart plan can launch multiple sessions with different context blocks.
  • Sessions with no context payload launch exactly as they do today.
  • Plan decoding remains backward compatible for older plans with no context field.
  • Plan review shows whether each session has context attached.

Tests

Add model decoding tests for old/new OrchestrationSession payloads and view-model tests that assembled context is passed to startNewSessionInHub per session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions