Skip to content

web: composer session chrome (model/effort, DFM, add current view) - #20

Merged
Code4me2 merged 5 commits into
mainfrom
cursor/composer-session-chrome-f298
Aug 31, 2026
Merged

Code4me2 merged 5 commits into
mainfrom
cursor/composer-session-chrome-f298

Conversation

@Code4me2

@Code4me2 Code4me2 commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Composer can already start a turn. This adds the remaining session chrome from #13, still as a thin client of server/.

What landed

  • Model + effort from GET /providers. The option identifier is the provider's own models[].id (qualified by provider id). No house model names. reasoning is projected only when the spec declared it; a model without it has no effort picker.
  • DFM chip, not a Plan mode. There is no engine Plan toggle. [dfm] auto_run / run_dfm is the equivalent and stays two controls (INTERFACE.md §6.4): a project-settings toggle (POST /project/config/dfm) and Run DFM (POST /parts/{part}/dfm). Collapsing them would imply a tool argument that does not exist.
  • Add current view / selection → context. An explicit action un-drops view (and selection when present) and opens the advisory POST /context/preview disclosure. View alone still does not name a reference until the operator adds it.

Named absence

If there is no runtime / no providers.json, the composer stays data-disabled-reason="agent_unavailable" with the cause and path. It does not render a model picker that would read as a signed-in agent. Credentials stay on the existing provider-attach surfaces.

Existing data-* selectors (data-composer, data-composer-state, data-context-chips, …) are unchanged.

Verification

  • Unit: pnpm --dir web typecheck / lint / test/stream/composer.test.tsx.
  • Playwright e2e/composer.spec.ts against a real heph serve --web: 8 passed, including DFM chrome on a part session (auto_run = false) and agent_unavailable hiding the model picker.
  • Manual: same G4 fixture in the browser — model id heph-fake/heph-fake-model, DFM auto-run + Run DFM, Add current view opens the advisory preview; no-runtime serve keeps the named absence and still offers Add current view.

Out of scope (parent #4)

Appearance, tree, export/BOM, CLI verbs, install, engine checkpoints, Scrapyard. This PR does not close #4.

Closes #13.

Open in Web Open in Cursor 

cursoragent and others added 4 commits August 31, 2026 01:03
Map model + effort from GET /providers using the provider's own model
ids. Project [dfm] auto_run / run_dfm as two composer controls, not a
per-message flag. Add current view opens POST /context/preview. Keep
agent_unavailable as the named absence when no runtime exists.

Co-authored-by: Vel <Code4me2@users.noreply.github.com>
The fixture starts [dfm] auto_run = false. A selected part must project the
two §6.4 controls, not a Plan toggle.

Co-authored-by: Vel <Code4me2@users.noreply.github.com>
The model/effort Selects wrote nothing: POST /sessions/{id}/prompt admits
{text, context?} only. Project the provider's own model id as a Fact and
name effort as off.

Add current view sent a view-only envelope the server collapsed as empty.
Treat an explicit view as a reference so the advisory preview composes
the camera token the operator added.

Co-authored-by: Vel <Code4me2@users.noreply.github.com>
Annotate the GET /providers model rows so append is not Unknown.
The untyped list was the lint+type failure on this PR.

Co-authored-by: Vel <Code4me2@users.noreply.github.com>

@Code4me2 Code4me2 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

MERGE

Adversarial review of #20 vs INTERFACE.md, issue #13, and the parent constraint (simple operator UI; CLI is the agent core). Two merge-blocking honesty bugs were in this PR's scope; they are fixed on this branch (e5bce92, 9c9f8d8). Do not merge until CI is green on 9c9f8d8.

The requested checks

model/effort match INTERFACE.md — yes, after the fix

POST /sessions/{id}/prompt is closed at {text, context?} (§2.3 / §7A.3). There is no model or effort member, and no house name. The first revision rendered Selects over local state that sendPrompt never sent. That is hosted-chat chrome over a field the route does not admit, and it is the same class of lie as a signed-in agent that is not there.

The chrome now projects GET /providers: the option identifier is the spec's own models[].id (qualified by provider id), rendered as a <Fact source="providers.models.id">. reasoning is still only projected when the spec declared it. Effort is the named off — Pi's closed levels stay in effortOptionsFor so a later route can name them, but the composer does not offer a picker that writes nothing.

Add current view match INTERFACE.md — yes, after the fix

§7A.3: the client sends references, never facts; preview is advisory POST /context/preview; the prompt composes again at send. View is an admitted envelope member. The first revision marked an explicit add as namesAReference on the client and left server ContextEnvelope.is_empty treating view as navigation-only, so a view-only envelope composed the empty block. The disclosure would have said the agent is told nothing.

is_empty now treats an explicit view as a reference. Tabs alone remain the blank canvas (test_the_blank_canvas_composes_nothing). test_an_explicit_view_is_composed_rather_than_collapsed and the case-2 e2e now require camera view: in the advisory block. Selection still un-drops when present; it already named a reference.

Does not turn the operator UI into a hosted chat — pass

No Recents, no conversation product, no second session mechanism, no prompt-body extension. Composer stays one tab / one session (§7A.1). DFM is not a Plan mode: two existing writes, not a per-message flag (§6.4). Model is a Fact, not a picker. Agents still write parts through heph.

Does not require MCP — pass

No serve.py change. --web stays orthogonal to --mcp (§2.1). Chrome rides GET /providers, POST /context/preview, POST /project/config/dfm, POST /parts/{part}/dfm — already on the closed REST table.

G4/G5 not weakened — pass

No G4/G5 fixture, golden, or gate file is in the diff. composer.spec.ts still names the G4.8 split as non-negotiable and creates sessions in the browser. Existing data-* selectors (data-composer, data-composer-state, data-context-chips, …) are unchanged. Stage gates 1–6 were green on the pre-fix head.

agent_unavailable still hides model chrome and DFM chrome; Add current view stays (preview is not gated on the runtime, §7A.3). Credentials stay on the attach / §23 surfaces.

What was merge-blocking (fixed here)

  1. Lying model/effort Selects — UI implied a per-turn choice INTERFACE.md does not have. Now a projection.
  2. Add current view composed nothing — client/server emptiness predicates disagreed. Server now composes the camera token.
  3. lint + type / pyright — models = [] made append Unknown. Annotated list[dict[str, Any]].

Named holes, not blocking

  • DFM e2e asserts the two §6.4 controls exist and auto_run starts false. It does not click them. Surfacing/round-trip coverage remains the existing DFM panel / HTTP tests; collapsing the two controls into one switch would still be a §6.4 defect.
  • effortOptionsFor documents Pi levels for a reasoning: true model. That is a vocabulary, not a control. Wiring it would be new engine work and is out of this PR.
  • DfmPanel remains the read half. Composer now owns the two writes §6.4 asked the workspace to expose. Duplicate write surfaces later would be the bug, not this placement.

Verification I ran

  • uv run pytest server/tests/test_context_envelope.py — 22 passed
  • uv run pytest server/tests/test_http_providers.py::test_get_providers_projects_model_ids_and_reasoning_without_house_names — passed
  • uv run pyright on the touched server files — clean
  • pnpm --dir web typecheck && lint && test — 399 passed

I did not merge. I did not expand scope past the honesty bugs in this slice.

@Code4me2
Code4me2 marked this pull request as ready for review August 31, 2026 02:24
@Code4me2
Code4me2 merged commit 6e2d22d into main Aug 31, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web: composer model/effort, Plan/DFM, Add current view web: Smith-class operator session (simple UI, CLI is the agent core)

2 participants