Skip to content

F10: Agent session (t3code instance) as draggable — move threads between projects #13

Description

@rororowyourboat

Summary

Define a "t3code instance" as a Thread with an active Agent Session, and allow the user to move it between Projects within the same Client by dragging it in the sidebar.

Definition

A t3code instance is a Thread where `session.status` is not in `{stopped, null}`. The sidebar differentiates these from inactive Threads with a visual activity indicator.

Scope

  • Add new command: `thread.project.reassign` with `{threadId, targetProjectId}`
  • Add new event: `thread.project.reassigned` with `{threadId, previousProjectId, targetProjectId}`
  • Decider validates:
    • Source and target Projects belong to the same Client
    • Source and target Projects share the same `workspaceRoot` (agent context is workspace-bound)
  • Projector updates Thread's `projectId`
  • All associated Terminals move with the Thread (they reference threadId, not projectId directly)

Sidebar UI

  • Thread items with active agent sessions show an activity indicator (pulsing dot or similar)
  • Thread items are draggable within the sidebar
  • Valid drop zones: Projects within the same Client that share the same `workspaceRoot`
  • Invalid drops (different Client, different workspaceRoot): show rejection feedback with explanation

Edge cases

  • Thread with active turn during drag: move permitted, turn continues
  • Thread with no agent session: move still permitted (regular Thread move)
  • Drop onto Project in a different Client: rejected ("Move Projects between Clients, not Threads")

Key files to modify

  • `packages/contracts/src/orchestration.ts` — new command/event schemas
  • `apps/server/src/orchestration/decider.ts` — validation logic
  • `apps/server/src/orchestration/projector.ts` — update Thread's projectId
  • `apps/web/src/components/Sidebar.tsx` — Thread drag + validation + drop zones

Dependencies

  • F2 (Client-Project binding — need to know which Client a Project belongs to)

Acceptance criteria

  • Threads with active sessions show visual indicator
  • Can drag a Thread to another Project in same Client (same workspaceRoot)
  • Agent session continues running after move
  • Terminals associated with the Thread move with it
  • Cross-Client Thread moves rejected with explanation
  • Different-workspaceRoot moves rejected with explanation
  • Threads without agent sessions can also be moved

Activity

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

    P3Priority 3 - Advancedclient-hierarchyClient hierarchy & workspace organizationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions