feat(agent-adapter): advertise approval tiers before session start - #305
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f436c454a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # packages/host/agent-adapter/src/native/claude-code.ts
lucas77778
self-requested a review
July 29, 2026 12:49
lucas77778
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes CODE-463.
The gap
The pre-session agent catalog landed in
38c6389fwith the whole schema → engine → client → UI chain, but onlypiever overrodestartCatalog.claude-code,opencodeandgrok-buildinherited the base default, andcodex(which gained a catalog later, for the effort work) returned a hardcodedpolicies: []:new-session-surface.tsxgates the approval-policy control oncatalog && catalog.policies.length > 0, soapprovalPolicyresolved toundefinedand the New Task surface rendered no picker for four of the five agents. In-session reflection was never affected —claude-codestill advertisesavailablePoliciesonce a session starts — which is why this reads as "the picker disappeared on New Task" rather than "the feature is gone".What this does
Fills in the missing half, so every adapter advertises the tiers a session would actually run under, and honors a pick made before the session exists.
permissions.defaultModeasdefaultPolicyIdacceptEditsconfig.tomlsandbox from the first turn, exactly like a live switch; unknown id degrades toacceptEditsbypassPermissionstierset-approval-policystill rejects)opencode's selectable-agent and reachable-model mapping moved to two module-level pure functions so the live
onStartfetches and the pre-session read share one definition instead of drifting.A failed pre-session read degrades to an empty axis rather than blocking session creation, matching the live best-effort catalog fetches.
Notes
grok-buildis beyond the original scope (it postdates the work this restores), but leaving it out would have shown the picker for four of five agents.AgentStartCatalogSchemaalready carriespolicies/defaultPolicyId, and the engine forwards the catalog verbatim.Verification
pnpm check:ciandpnpm testboth pass (2011 passed / 5 skipped). New coverage: pre-session catalog contents per adapter, the initial-pick path, and the degrade-with-error path; codex additionally asserts that a new-session pick overrides a configured sandbox while an unknown one does not.Not yet driven in the running app — the adapter contract is covered by tests, and the engine/client legs of the chain were already live for
pi.