Skip to content

feat(web): per-tab project header, v1 ShellService - #63

Merged
cooper (czxtm) merged 1 commit into
mainfrom
feat/studio-shell-v1-project-header
Sep 23, 2026
Merged

cooper (czxtm) merged 1 commit into
mainfrom
feat/studio-shell-v1-project-header

Conversation

@czxtm

Copy link
Copy Markdown
Member

Each Studio tab now names the project its Connect calls act on (ADR 0005).

  • The tab's selected project is kept in sessionStorage, keyed by agent host and port. Once a project is selected, every Connect call sends X-Stackpanel-Project. Without a selection nothing is sent, and the agent uses its current project as before.
  • The transport is rebuilt per selection. connect-query caches are keyed by transport, and other queries are reset synchronously on switch, so no view shows the previous project's data.
  • The picker opens a project over REST first and then selects it.
  • Shell status and rebuild move to v1 ShellService.
  • The old AgentService GetShellStatus/RebuildShell RPCs are deleted, along with their Go handler, their generated code (regenerated, then nix fmt) and the old hooks.

Verification by the implementer, in the devshell:

  • tsgo on apps/web reports 98 errors, a normalized set identical to origin/main.
  • Web tests: 61 pass, plus the known R2 failure. There are 6 new tests, each confirmed to fail when its behaviour is broken. The breakages tried were: the reset removed, the reset moved into an effect, the project dropped from the transport, and selecting before opening.
  • go build and go vet pass. go test ./internal/agent/... fails only TestSetupAcknowledgementRequiresAuthAndProjectEvidence, which already fails on main.
  • A live Playwright run against a real stack agent with two projects:
    • Before any selection, no header is sent.
    • After adding and opening project B, calls carry the header and go to B's runtime.
    • Switching back routes calls to the repo's runtime.
    • The selection survives a reload.

Refs stackpanel-thq.8.1.2, ADR 0005

Each Studio tab now names the project its Connect calls act on (ADR
0005). AgentProvider keeps the tab's selected project ID in
sessionStorage, keyed by agent host and port, so a reload keeps it while
other tabs stay on their own projects, and exposes it with
selectProject() on the agent context. The shared transport is built per
project, and an interceptor sends X-Stackpanel-Project on every call once
a project is selected. Without a selection nothing is sent and the agent
uses its current project, as before.

No query can show the previous project's data after a switch.
Connect-query keys include the transport, so every project has its own
cache entries. Queries outside connect-query (the AgentService and REST
hooks) are keyed without the project, so selecting a project resets them
before the next render. The picker opens the project over REST first and
selects it only once the agent has switched, so those refetches already
read the new project. It shows the tab's selected project, or the agent's
current one until the tab selects one. The header's shell indicator
remounts per project, so rebuild output and live shell events don't carry
over.

Shell status and rebuild use v1 ShellService over the shared transport:
GetShellStatus through connect-query, RebuildShell through createClient
and for-await over its started/output_line/completed oneof. A ConnectError
that ends the stream resolves the rebuild as failed with its message, as
the old in-band error event did, instead of throwing. The demo answers
GetShellStatus with the v1 field names.

With their last callers gone, AgentService's GetShellStatus and
RebuildShell are removed along with the four messages only they used,
their Go handlers, and RebuildEvent.Timestamp, which only the old handler
read. packages/proto/gen was regenerated with buf generate and formatted
with nix fmt, and the JSON schemas of the removed messages were deleted.
connect_entities_gen.go regenerated with only its lines reordered, so it
is unchanged.

Refs: stackpanel-thq.8.1.2
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Preview pr-63 has been destroyed.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview pr-63 has been destroyed.

@czxtm
cooper (czxtm) merged commit 0600d65 into main Sep 23, 2026
16 of 17 checks passed
@czxtm
cooper (czxtm) deleted the feat/studio-shell-v1-project-header branch September 23, 2026 15:49
@linear-code

linear-code Bot commented Sep 23, 2026

Copy link
Copy Markdown

ENG-846

This branch was successfully deployed

2 active deployments
docs-preview — 5675fbfd Deployed Sep 23, 2026 by czxtm via deploy #209
pr-63 — 5675fbfd Deployed Sep 23, 2026 by czxtm via deploy #223
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.

1 participant