Skip to content

add tech spec#12794

Draft
harryalbert wants to merge 9 commits into
kevin/prototype-tuifrom
harry/core-tui-model
Draft

add tech spec#12794
harryalbert wants to merge 9 commits into
kevin/prototype-tuifrom
harry/core-tui-model

Conversation

@harryalbert

Copy link
Copy Markdown
Contributor

Description

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

harryalbert commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@harryalbert harryalbert mentioned this pull request Jun 18, 2026
4 tasks
@harryalbert harryalbert force-pushed the harry/core-tui-model branch 2 times, most recently from 5b1e645 to cf427d4 Compare June 18, 2026 17:54
@kevinyang372 kevinyang372 changed the base branch from kevin/prototype-tui to graphite-base/12794 June 18, 2026 18:18
Comment thread specs/core-tui-model/TECH.md Outdated
A **headless, view-tree-free** test drives the TUI agent core. It:
- Initializes the TUI singleton graph in a test app context.
- Constructs a synthetic `AgentSessionOwnerId` from a fresh `EntityId` — no `TerminalView`, no `RootTuiView`, no runtime/driver. This proves conversation ownership is fully decoupled from views.
- Submits prompt `"first"` and feeds a fake streamed response.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we feeding a fake streamed response? This should be wired to the server
(we might need to reuse the warp-dev auth credential since we are not building the auth flow in the prototype)

Comment thread specs/core-tui-model/TECH.md Outdated
GUI terminal call sites keep working by passing an `AgentSessionOwnerId::new(terminal_view_id)`. This is a sizable but mechanical change; it should land as its own PR ahead of the TUI model.

### 3. Split app initialization into phases
Today `initialize_app` (`app/src/lib.rs:1142-2175`) is a ~1000-line monolith run for every non-TUI mode; afterwards `launch` (`app/src/lib.rs:2627`) builds the GUI workspace. `LaunchMode::Tui` bypasses **both** via an early short-circuit (`app/src/lib.rs:1079-1084`) that just calls `tui::init`. To give the TUI a real singleton graph, we decompose `initialize_app` into ordered phases, share the backend-neutral + agent phases, and give GUI and TUI their own final phase.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this prototype, I think it's fine for us to initialize all these singleton models that the main app uses (these should be cheap)

We just need to skip the heavy weight ones like terminal_server process

Comment thread specs/core-tui-model/TECH.md Outdated
/// concurrent sessions work out of the box even though the root view is the
/// only owner today.
pub struct CoreTuiModel {
sessions: HashMap<AgentSessionOwnerId, TuiAgentSession>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the prototype -- we can assume there is only one session (we're not gonna prototype orchestration today)

/// only owner today.
pub struct CoreTuiModel {
sessions: HashMap<AgentSessionOwnerId, TuiAgentSession>,
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we hold the agent controller and action model here? We shouldn't hand roll our own logic around action dispatching / streaming etc

@harryalbert harryalbert force-pushed the harry/core-tui-model branch from db79a25 to 9ab0f32 Compare June 18, 2026 19:17
@harryalbert harryalbert changed the base branch from graphite-base/12794 to kevin/prototype-tui June 18, 2026 19:17
@kevinyang372 kevinyang372 changed the base branch from kevin/prototype-tui to graphite-base/12794 June 18, 2026 19:59
@harryalbert harryalbert force-pushed the harry/core-tui-model branch from 9ab0f32 to 9b40b7c Compare June 18, 2026 22:05
@harryalbert harryalbert changed the base branch from graphite-base/12794 to kevin/prototype-tui June 18, 2026 22:05
@kevinyang372 kevinyang372 changed the base branch from kevin/prototype-tui to graphite-base/12794 June 18, 2026 22:32
@harryalbert harryalbert force-pushed the harry/core-tui-model branch from ab44945 to 93ca9b5 Compare June 18, 2026 22:51
@harryalbert harryalbert changed the base branch from graphite-base/12794 to kevin/prototype-tui June 18, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants