Commit Graph
4 Commits
Author SHA1 Message Date
Eric Traut ddfaef91b2 Report HTTP MCP startup problems clearly in codex exec (#62906)
## Why

Low-level transport errors can clutter stderr and include endpoint
URLs with credentials. An optional HTTP MCP server can also still be
starting when its tools are omitted from a turn.

## What changed

- Warn once per Streamable HTTP connection when startup fails or the
  server is omitted from the turn because startup is still pending.
  Include the server name and a short reason without the raw transport
  error.
- Filter redundant MCP worker errors from default `codex exec` stderr
  and preserve caller control through `RUST_LOG`.
- Add server context to errors when startup blocks a tool call or
  resource operation, when a tool call finds a disconnected server,
  or when HTTP session recovery fails.

## Testing

Add regression coverage for startup warnings, credential omission,
explicit `RUST_LOG` diagnostics, and an optional server that becomes
ready in time to be included in the turn.

GitOrigin-RevId: 1fd012a5e73f205c3d8735adde395c36672c205c
2026-11-21 05:57:16 +00:00
Eric Traut 11ca3f7531 Require explicit project trust in non-interactive runs (#60041)
## What changed

Keep untrusted project configuration and MCP servers disabled in exec runs, even with `--sandbox workspace-write`, and warn when project configuration is disabled.

Add `--trust` to `codex exec` and `codex review` to save project trust for the current and future chats, including MCP commands outside the sandbox. The grant persists with `--ephemeral`, refuses explicitly untrusted projects, and cannot be combined with `--ignore-user-config`.

Pass the working directory as a configuration default so embedded server startup does not implicitly grant trust. Preserve the selected `--oss` provider across configuration reloads.

## Testing

Extend CLI parsing and MCP integration coverage for explicit trust, persistence across ephemeral runs, disabled project configuration with write access, and rejection of conflicting or explicitly untrusted settings.

GitOrigin-RevId: b57f4f8829f98d77c5487fa8405c7f29b5d70d0c
2026-11-07 02:39:03 +00:00
pakrym-oai e752f7b4ae [codex] Use expect in integration tests (#28441)
The workspace denies `clippy::expect_used` in production. Although
`clippy.toml` allows `expect` in tests, Bazel Clippy compiles
integration-test helper code in a way that does not receive that
exemption, which encouraged verbose `unwrap_or_else(... panic!(...))`
and equivalent `match`/`let else` forms.

This allows `clippy::expect_used` once at each integration-test crate
root (including aggregated suites and test-support libraries), then
replaces manual panic-based Result and Option unwraps with
`expect`/`expect_err`. Standalone `tests/*.rs` files remain their own
crate roots. Intentional assertion and unexpected-variant panics remain
unchanged, and the production `expect_used = "deny"` lint remains in
place.

The cleanup is mechanical and net-negative in line count.
2026-06-15 21:53:47 -07:00
jif-oai aab61934af Handle required MCP startup failures across components (#10902)
Summary
- add a `required` flag for MCP servers everywhere config/CLI data is
touched so mandatory helpers can be round-tripped
- have `codex exec` and `codex app-server` thread start/resume fail fast
when required MCPs fail to initialize
2026-02-06 17:14:37 +01:00