Skip to content

feat(src-tauri): forward a fleet arg through the roster/identity bridge commands - #150

Merged
brettchien merged 1 commit into
mainfrom
orca/src-tauri-fleet-roster-bridge
Sep 7, 2026
Merged

feat(src-tauri): forward a fleet arg through the roster/identity bridge commands#150
brettchien merged 1 commit into
mainfrom
orca/src-tauri-fleet-roster-bridge

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Summary

studio#146 slice 3 of 4 (k8s fleet roster/observe UI). deploy_list and runtime_context (the Tauri bridge commands backing the console's roster/identity reads, src-tauri/src/lib.rs) gain an optional fleet: Option<String> parameter, forwarded to the underlying deploy_list/deploy_get/runtime_context MCP tool calls alongside cluster.

This is the plumbing a k8s-runtime fleet's roster/identity needs to reach oab-mcp's k8s dispatch added in slice 2 (#149) — cluster alone has no k8s equivalent (a k8s fleet resolves by context+namespace, carried on the fleet binding, not a bare cluster string).

No Rust compile-time dependency on #149 — the bridge calls the MCP tool by string name with a JSON args object (client.call_tool("deploy_list", json!({...}))), not a typed Rust function, so this only needs the tool's arg contract (stable, defined in #149) rather than #149 actually being merged. Opened directly off main, not stacked on #149's branch.

fleet is a new trailing optional parameter on two already-registered #[tauri::command]s — no generate_handler! change needed. Existing callers that omit it (the whole console, today) get their exact current cluster-only behavior; nothing consumes the new parameter yet — that's slice 4 (console/src/main.ts+source.ts).

Test plan

  • No local build signal for this layer (studio-desktop/src-tauri isn't a workspace member and needs macOS/GTK system libs this sandbox doesn't have — per [[studio-tauri-bridge-layer-gotcha]]). Reviewed by hand against the surrounding bridge functions' existing pattern (the params["provider"] = json!(p) idiom deploy_provision_agent's bridge already uses for the same "conditionally add a JSON key" shape). Only the bundle-macos CI job (on a real macOS runner) verifies this actually compiles.
  • Confirmed via git grep/reading that deploy_list/runtime_context are the only two Tauri commands the console's roster/identity path calls (deploy_get has no separate bridge command — roster_over_mcp calls the MCP tool deploy_get directly per service, not through its own Tauri command), so no other bridge function needed this parameter.

🤖 Generated with Claude Code

…ge commands

studio#146 slice 3 of 4. `deploy_list` and `runtime_context` (the two
Tauri bridge commands backing the console's roster/identity reads) gain
an optional `fleet: Option<String>` parameter, forwarded to the
underlying `deploy_list`/`deploy_get`/`runtime_context` MCP tool calls
alongside `cluster`. This is what a k8s-runtime fleet's roster/identity
needs to reach oab-mcp's new k8s dispatch (studio#146 slice 2, PR #149) —
`cluster` alone has no k8s equivalent to resolve against.

No Rust compile-time dependency on slice 2 — the MCP call is JSON/string
dispatched, not typed, so this only needs the tool arg *contract* (stable,
defined in #149) not its merge. `fleet` is a new trailing optional
parameter on two already-registered `#[tauri::command]`s, so no
`generate_handler!` change is needed, and existing callers that omit it
keep their exact current (cluster-only) behavior — nothing in the console
passes `fleet` yet, that's slice 4.

Per studio-tauri-bridge-layer-gotcha: this layer has no local build
signal in this sandbox (`studio-desktop` isn't a workspace member, needs
macOS/GTK system libs this environment doesn't have) — reviewed by hand
against the surrounding bridge functions' existing pattern (the
`params["provider"] = json!(p)` idiom `deploy_provision_agent`'s bridge
already uses), only `bundle-macos` CI verifies it actually builds.

🤖 Generated with Claude Code
@brettchien
brettchien merged commit 0cd1aea into main Sep 7, 2026
2 checks passed
@brettchien
brettchien deleted the orca/src-tauri-fleet-roster-bridge branch September 7, 2026 10:20
brettchien added a commit that referenced this pull request Sep 7, 2026
…151)

studio#146 slice 4 of 4 (final slice) — the console-side fix for the
originally-reported bug: clicking a k8s-runtime fleet in the Fleets panel
now actually opens Fleet detail and loads its roster, instead of
`selectFleet` showing an info toast and refusing to switch.

- `source.ts`: `listDeployments`/`runtimeContext` gain an optional `fleet`
  param, forwarded to the Tauri bridge (#150) alongside `cluster`.
- `main.ts`: `selectFleet` branches on `fleet.runtime` instead of
  declining for k8s — `activeCluster` becomes an unused "" sentinel for a
  k8s fleet (reads now go by `fleet` name, which oab-mcp resolves to the
  bound context/namespace, #149), and the header label shows
  `context/namespace` instead of a cluster. `tick()` now always passes
  `activeFleet` as `fleet` to `listDeployments` (a no-op for the
  no-fleet-selected case, and for an ecs fleet this only makes oab-mcp's
  existing member-side filtering redundant with the console's own
  `filterByMembers` — same result, not a behavior change).
- `types.ts`: `RuntimeContext.cluster` is `string | null` now (`null` for
  a k8s-runtime fleet, with `context`/`namespace` set instead); `FleetBinding`
  gained optional `context`/`namespace` fields alongside the existing
  `profile`/`region`. `runtimeContext()` itself has no console call site
  yet (true before this change too) — this is type-contract parity with
  oab-mcp's tool, not new UI.

**Not in scope** (matches the issue body): start/stop (scale) for a k8s
roster row isn't wired — `scale()` still calls `scaleDeployment` without a
`fleet` arg, so it'll hit the ecs-only `deploy_scale` path and fail with a
clear error toast (not silently) if attempted against a k8s deployment.
That's a separate action-surface follow-up, not blocking this read-only
roster view.

## Test plan

- `npm test`: 107/107 passing (no new tests — this is control-flow
  wiring over already-tested pure functions; `filterByMembers`/
  `serviceName` already have k8s-shaped-data coverage from the delete-fleet/
  member-name-preview work).
- `npm run typecheck`: clean.
- `npm run build`: clean.
- Manual: no live k8s cluster in this sandbox to exercise end-to-end —
  same caveat #149 already carries.

🤖 Generated with Claude Code
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