Repository navigation
web: composer session chrome (model/effort, DFM, add current view) - #20
Conversation
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
left a comment
There was a problem hiding this comment.
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)
- Lying model/effort Selects — UI implied a per-turn choice INTERFACE.md does not have. Now a projection.
- Add current view composed nothing — client/server emptiness predicates disagreed. Server now composes the camera token.
lint + type/ pyright —models = []madeappendUnknown. Annotatedlist[dict[str, Any]].
Named holes, not blocking
- DFM e2e asserts the two §6.4 controls exist and
auto_runstarts 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. effortOptionsFordocuments Pi levels for areasoning: truemodel. That is a vocabulary, not a control. Wiring it would be new engine work and is out of this PR.DfmPanelremains 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 passeduv run pytest server/tests/test_http_providers.py::test_get_providers_projects_model_ids_and_reasoning_without_house_names— passeduv run pyrighton the touched server files — cleanpnpm --dir web typecheck && lint && test— 399 passed
I did not merge. I did not expand scope past the honesty bugs in this slice.
Composer can already start a turn. This adds the remaining session chrome from #13, still as a thin client of
server/.What landed
GET /providers. The option identifier is the provider's ownmodels[].id(qualified by provider id). No house model names.reasoningis projected only when the spec declared it; a model without it has no effort picker.[dfm] auto_run/run_dfmis 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.POST /context/previewdisclosure. 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 staysdata-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
pnpm --dir webtypecheck / lint /test/stream/composer.test.tsx.e2e/composer.spec.tsagainst a realheph serve --web: 8 passed, including DFM chrome on a part session (auto_run = false) andagent_unavailablehiding the model picker.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.