Skip to content

Phase 2A — Agent shape (iframe wrapping T3 Code embedded thread) #3

Closed

Description

@rororowyourboat

Goal

First-class agent tile: create → T3 Code thread created → agent tile rendered with iframe pointing at `/embed/thread/?minimal=1` → live streaming conversation inside the tile.

Blocked by

Acceptance criteria

  • Press `g` or click "Agent" in toolbar → click canvas → "New Agent" dialog appears (cwd/provider/model)
  • On submit: calls T3 Code `createThread(cwd, provider, model)`, stores `threadId` on the shape
  • Agent shape renders an `<iframe>` pointing at T3 Code's embed route
  • Conversation streams inside the tile (validated against real T3 Code session)
  • Closing tile does NOT stop the T3 Code thread (thread persists)
  • Close/reopen t3-canvas → same `threadId` reconnects, conversation history still visible
  • Shape props are runtime-validated via T validators
  • Schema migrations file exists (even if empty v1)

Scope

~555 LOC.

Files

  • `electron/t3-client.ts` — WebSocket client (createThread, listThreads, getThread)
  • `electron/ipc.ts` — expose t3-client
  • `renderer/lib/t3-client-hook.ts` — React hook
  • `renderer/shapes/AgentShape/{AgentShapeUtil,AgentShapeTool,NewAgentDialog,types,migrations}.ts`
  • `renderer/canvas/shape-registry.ts` — register shape + tool
  • `renderer/canvas/ui-overrides.tsx` — add "Agent" to toolbar

Non-goals

  • Native React rendering (that's Phase 6 — iframe is fine for MVP)
  • Agent lifecycle supervision
  • Reconnect on T3 Code server restart (best-effort)
  • Multi T3 Code server support

Worktree

```bash
git worktree add ../t3-canvas-agent -b feat/phase-2-agent-shape
```

Reference

Activity

  1. rororowyourboat commented on Apr 9, 2026

    @rororowyourboat
    OwnerAuthor

    Cross-repo prerequisite complete: the T3 Code embed-thread route is up for review at rororowyourboat/t3code#2, closing t3code#1. Once that PR merges, this issue becomes unblocked on the embed-route dependency (still blocked on #2 Phase 1 skeleton).

  2. rororowyourboat commented on Apr 9, 2026

    @rororowyourboat
    OwnerAuthor

    Merged in #12. Agent shape tile works: click Agent in toolbar → dialog collects t3ServerUrl/environmentId/threadId → iframe embeds T3 Code thread. Manual thread-id entry for now (no WebSocket client yet — that's Phase 6 territory). Validated live by user.

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

    blockedWaiting on a dependencyphase/2Phase 2 — Agent shape

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions