Skip to content

fix(src-tauri): register missing Tauri command bridges for k8s onboarding tools (studio#104) - #117

Merged
brettchien merged 1 commit into
mainfrom
fix/tauri-bridge-k8s-list-tools
Aug 28, 2026
Merged

fix(src-tauri): register missing Tauri command bridges for k8s onboarding tools (studio#104)#117
brettchien merged 1 commit into
mainfrom
fix/tauri-bridge-k8s-list-tools

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Summary

Real bug, caught by Brett running the actual app: "New fleet" wizard with provider=Kubernetes showed namespace list unavailable: Command list_namespaces not found.

Root cause: Tauri requires every frontend-callable command explicitly registered (#[tauri::command] + generate_handler![...]) — a separate bridge layer between the console's invoke() calls and the oab-mcp sidecar's MCP tools. #104/#111's work added 5 new MCP tools (list_aws_profiles, list_k8s_contexts, list_namespaces, list_service_accounts, k8s_fleet_config_write) and the console code that calls them, but never added this bridge layer. Verification earlier in this effort checked the MCP tool layer and the frontend call sites, but missed this middle layer entirely — there was no way to catch it without actually running the desktop app, which this environment can't do.

Fix

Adds the 5 missing bridge commands, each mechanically mirroring the existing fleet_config/fleet_config_write pattern (lock the sidecar client, call_tool, log + propagate errors on failure). Also extends deploy_provision's bridge with provider/context/expected_principal so the k8s dispatch path (already wired server-side) is reachable once console's "Kubernetes provisioning isn't available yet" block is eventually lifted — not reachable today (that block is still in place), included here since it's the same class of gap and there's no reason to leave it half-fixed.

Verification

src-tauri (package studio-desktop) is not a member of the root Cargo workspace — it's Tauri's own project, building the macOS desktop shell (CI's bundle-macos job, distinct from build-test). Confirmed this environment can't compile it at all — missing system glib-2.0/GTK dev packages (a different, unrelated blocker from the aws-sdk-ec2 OOM hit everywhere else in this effort). Every new function here is a mechanical mirror of an already-working sibling (fleet_config_write), hand-verified line by line against it. CI's bundle-macos job already builds this exact crate on a real macOS runner — that's the actual gate, more so than usual given the total lack of local signal here.

Ref #104.

…ding tools (studio#104)

Real bug, caught by Brett actually running the app: the console called
invoke("list_namespaces", ...) etc., and oab-mcp had the underlying MCP
tools, but nothing bridged them — Tauri requires every command explicitly
registered via #[tauri::command] + generate_handler![], and this layer was
never built for list_aws_profiles/list_k8s_contexts/list_namespaces/
list_service_accounts/k8s_fleet_config_write. Symptom: "Command
list_namespaces not found" in the running app, exactly what showed up.

Adds the five missing bridges, mirroring the existing fleet_config/
fleet_config_write pattern exactly (lock the core client, call_tool, log +
propagate errors). Also extends deploy_provision's bridge with
provider/context/expected_principal so the k8s dispatch path (already wired
server-side in oab-mcp) is actually reachable once console's "k8s not
available yet" block is lifted — not reachable yet today since that block
is still in place, but there's no point fixing the tool-listing bridges
without also completing this one, since it's the same class of gap.

Verification note: this crate (src-tauri, package studio-desktop) is NOT a
member of the root Cargo workspace — it's Tauri's own project, building the
macOS desktop shell specifically (CI's bundle-macos job, not build-test).
Confirmed it can't be locally compiled in this environment at all (missing
system glib-2.0/GTK dev packages this sandbox doesn't have, unrelated to
the aws-sdk-ec2 OOM constraint hit everywhere else this session) — every
new function here mechanically mirrors an already-working sibling
(fleet_config_write's exact shape), hand-verified against it line by line.
CI's bundle-macos job, which already builds this exact crate on a real
macOS runner, is the actual gate.

Ref: studio#104.
@brettchien
brettchien merged commit b49a423 into main Aug 28, 2026
2 checks passed
@brettchien
brettchien deleted the fix/tauri-bridge-k8s-list-tools branch August 28, 2026 07:51
brettchien added a commit that referenced this pull request Aug 28, 2026
…io#104) (#118)

Removes the client-side "Kubernetes provisioning isn't available yet"
block in deploy.ts's identity step — the backend dispatch (deploy_
provision's provider="k8s" path) and Tauri bridges have been reachable
since #117, this just connects the wizard's submit handler to them.

deployForm's submit now branches on provider: k8s calls deploy_provision
with provider/context/expected_principal (built from the selected
namespace + service account, in the system:serviceaccount:<ns>:<name>
form provision_from_library_k8s expects), then persists the new fleet to
fleets-k8s.toml via a new read/write pair — k8s_fleet_config (MCP tool +
Tauri bridge, mirroring fleet_config) plus the existing k8s_fleet_config_
write, since appending a block requires reading the current file first
and no such read tool existed yet.

Rust changes are hand-verified line by line, not locally compiled — this
environment reliably OOM-kills on aws-sdk-ec2 regardless of -j/codegen
settings (a known, pre-existing limitation, not new to this change); TS
side is verified for real (typecheck + 106/106 tests + build all pass).
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