Skip to content

fix(mecak8s): resolve hosted AS-1 before the execution checks; correct identity docs - #2647

Merged
ChrisJBurns merged 1 commit into
mainfrom
fix/identity-broker-startup-and-docs
Nov 2, 2026
Merged

ChrisJBurns merged 1 commit into
mainfrom
fix/identity-broker-startup-and-docs

Conversation

@ChrisJBurns

Copy link
Copy Markdown
Contributor

Summary

Follow-ups found while checking the agent identity work (#2454) against main, before starting #2493.

Code

  • mecak8s refused to start when it hosted AS-1 with remote execution enabled and --oidc-issuer unset (--execution-enabled requires OIDC caller ownership enforcement). The execution checks ran before resolveAS1Flags filled in the caller identity, contradicting the --identity-broker-as1-issuer help ("sets --oidc-issuer ... when unset"). AS-1 is now resolved first. The Helm chart was not affected because it always renders --oidc-issuer.

User docs

  • caller-identity.md: session open does not exchange tokens at AS-1 yet (that is Register the broker client at AS-1 and point the broker at it #2607), so the paragraph describing bearer_rejected/sign_in_required from the broker described behaviour no deployment can turn on. A request for another user's session gets session_not_found (404) from the server's ownership check, not identity_broker_session_refused (403); 403 remains for a session ID already paired with another user's broker session.
  • identity-and-client-access.md: with a hosted AS-1 the chart supplies the TUI client ID when oidc.acceptedClientIDs is unset, so "the chart rejects one without the other" had an exception. The sub_id example no longer lists studio, which does not support sub_id deployments.

Design

  • credentials-and-lifecycle.md, "Session end": a closed session's record keeps its closing reason and is found by root host session; after signed_out, upstream_revoked, or owner_action_required, the broker opens a new session for that host session only with an access token issued after the revocation. This is the end state Sign-out and revocation #2568 implements (scope moved there from Reopen the broker session after access ends #2493).

Testing

  • New TestHostedAS1EnablesExecutionWithoutOIDCIssuer (fails before the fix, passes after).
  • task lint: clean except a pre-existing darwin-only gosec finding in environment/microvm/launch_ownership_darwin.go:754, a file this PR does not touch.
  • task test:race: cmd/mecak8s passes. Three tests fail locally on macOS and fail identically on a clean main checkout, so they are environmental: TestMecatedCLICompositionValidatesMicroVMDefaultAfterReadiness (unix socket under /dev/fd), TestRunInDirUsesDescriptorAndPassesArgumentsOpaquely (env: bash not found), and TestStartupCompatibilityEmbeddedRejected.
  • task site:build passes. task docs:check/matlatl: no findings in changed files. go run ./cmd/mecademo shows tool call, permission ask/approval, and result.

API compatibility

No wire change: flag parsing order in cmd/mecak8s and documentation only.

mecak8s refused to start with a hosted AS-1, remote execution enabled,
and --oidc-issuer unset: the execution checks ran before resolveAS1Flags
filled in the caller identity the --identity-broker-as1-issuer help says
it sets.

Also correct the identity user docs (session open does not exchange
tokens at AS-1 yet; another user's session is a 404; a hosted AS-1
supplies the accepted client ID; Studio does not support sub_id) and
record in the design that a closed session keeps its closing reason,
found by host session, and is not reopened after sign-out or revocation
without a token issued after it.

Co-authored-by: Mecatl <[email protected]>
@ChrisJBurns
ChrisJBurns merged commit 762eb04 into main Nov 2, 2026
42 checks passed
@ChrisJBurns
ChrisJBurns deleted the fix/identity-broker-startup-and-docs branch November 2, 2026 19:37
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Nov 18, 2026
2 tasks

This branch was successfully deployed

1 active deployment
Preview — 5ea3d429 Deployed Nov 2, 2026 by vercel[bot]
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.

2 participants