Allow per-tool approval reviewers for Codex apps (#62360)

## Why

A connected account or app can choose an approval reviewer, but that
setting applies across its tools. Users may want to review calendar
event creation themselves while keeping automatic review for other tools.

## What changed

Set `approvals_reviewer` on an individual app tool in `config.toml`:

```toml
[apps.calendar.tools.calendar_create_event]
approvals_reviewer = "user"
```

Codex matches the tool by raw name first and falls back to its title.
The tool's reviewer takes precedence over the connected account, app,
app defaults, and session settings, subject to managed requirements.
This applies to tool-call approval prompts and MCP approval requests
that match a verified app tool invocation. The app-server
`config/read` response also exposes the per-tool setting.

## Testing

Extend coverage for reviewer precedence, tool title fallback, managed
review requirements, tool-call approval routing, strict MCP elicitation,
and app-server config reads.

GitOrigin-RevId: c92bd39b9e708dada9d314c19a446b4c580edf91
This commit is contained in:
jameswt-oai
2026-11-18 20:42:18 +00:00
committed by copyberry
parent 5387162ef0
commit 1b80bd9412
20 changed files with 204 additions and 60 deletions
@@ -263,14 +263,6 @@ class AppToolApproval(Enum):
approve = "approve"
class AppToolConfig(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
approval_mode: AppToolApproval | None = None
enabled: bool | None = None
class AppToolSummary(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
@@ -7594,6 +7586,15 @@ class AppTemplateSummary(BaseModel):
template_id: Annotated[str, Field(alias="templateId")]
class AppToolConfig(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
approval_mode: AppToolApproval | None = None
approvals_reviewer: ApprovalsReviewer | None = None
enabled: bool | None = None
class ApplicationNetworkRequirements(BaseModel):
model_config = ConfigDict(
populate_by_name=True,