Commit Graph

11727 Commits

Author SHA1 Message Date
Michael Bolin
83bb4e402d Merge 6b5bfc92cb into sapling-pr-archive-bolinfest 2026-04-17 11:24:51 -07:00
Michael Bolin
6b5bfc92cb ci: scope Bazel repository cache by job 2026-04-17 11:24:36 -07:00
Michael Bolin
3f0a79c78a Merge 44bf27d94e into sapling-pr-archive-bolinfest 2026-04-17 11:23:55 -07:00
Michael Bolin
44bf27d94e tests: isolate approval fixtures from host rules 2026-04-17 11:22:07 -07:00
Michael Bolin
f40015eb1b shell-escalation: carry resolved permission profiles 2026-04-17 11:22:07 -07:00
Michael Bolin
11e5c5f0cd mcp: include permission profiles in sandbox state 2026-04-17 11:22:07 -07:00
Michael Bolin
a03f993fdf tui: carry permission profiles on user turns 2026-04-17 11:22:07 -07:00
Michael Bolin
771307b702 tui: sync session permission profiles 2026-04-17 11:22:07 -07:00
Michael Bolin
8b4d2a26cf app-server: accept command permission profiles 2026-04-17 11:22:07 -07:00
Michael Bolin
b675c8c010 protocol: report session permission profiles 2026-04-17 11:22:07 -07:00
Michael Bolin
1f38d31b62 rollout: persist turn permission profiles 2026-04-17 11:22:07 -07:00
Michael Bolin
853bd3b485 clients: send permission profiles to app-server 2026-04-17 11:22:07 -07:00
Michael Bolin
844c1fad0f app-server: accept permission profile overrides 2026-04-17 11:22:07 -07:00
Michael Bolin
1d58b0b789 app-server: expose thread permission profiles 2026-04-17 11:22:07 -07:00
Michael Bolin
20d17a1e1c core: derive active permission profiles 2026-04-17 11:22:06 -07:00
Michael Bolin
cf557e0b35 exec-server: carry filesystem sandbox profiles 2026-04-17 11:22:06 -07:00
Michael Bolin
ee37dcfea7 sandboxing: intersect permission profiles semantically 2026-04-17 11:22:06 -07:00
Michael Bolin
577cde3723 protocol: canonicalize file system permissions 2026-04-17 11:22:06 -07:00
Michael Bolin
2c2ed51876 ci: make Windows Bazel clippy catch core test imports (#18350)
## Why

Unused imports in `core/tests/suite/unified_exec.rs` in the Windows
build were not caught by Bazel CI on
https://github.com/openai/codex/pull/18096. I spot-checked
https://github.com/openai/codex/actions/workflows/rust-ci-full.yml?query=branch%3Amain
and noticed that builds were consistently red. This revealed that our
Cargo builds _were_ properly catching these issues, identifying a
Windows-specific coverage hole in the Bazel clippy job.

The Windows Bazel clippy job uses `--skip_incompatible_explicit_targets`
so it can lint a broad target set without failing immediately on targets
that are genuinely incompatible with Windows. However, with the default
Windows host platform, `rust_test` targets such as
`//codex-rs/core:core-all-test` could be skipped before the clippy
aspect reached their integration-test modules. As a result, the imports
in `core/tests/suite/unified_exec.rs` were not being linted by the
Windows Bazel clippy job at all.

The clippy diagnostic that Windows Bazel should have surfaced was:

```text
error: unused import: `codex_config::Constrained`
 --> core\tests\suite\unified_exec.rs:8:5
  |
8 | use codex_config::Constrained;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`

error: unused import: `codex_protocol::permissions::FileSystemAccessMode`
  --> core\tests\suite\unified_exec.rs:11:5
   |
11 | use codex_protocol::permissions::FileSystemAccessMode;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused import: `codex_protocol::permissions::FileSystemPath`
  --> core\tests\suite\unified_exec.rs:12:5
   |
12 | use codex_protocol::permissions::FileSystemPath;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused import: `codex_protocol::permissions::FileSystemSandboxEntry`
  --> core\tests\suite\unified_exec.rs:13:5
   |
13 | use codex_protocol::permissions::FileSystemSandboxEntry;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: unused import: `codex_protocol::permissions::FileSystemSandboxPolicy`
  --> core\tests\suite\unified_exec.rs:14:5
   |
14 | use codex_protocol::permissions::FileSystemSandboxPolicy;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

## What changed

- Run the Windows Bazel clippy job with the MSVC host platform via
`--windows-msvc-host-platform`, matching the Windows Bazel test job.
This keeps `--skip_incompatible_explicit_targets` while ensuring Windows
`rust_test` targets such as `//codex-rs/core:core-all-test` are still
linted.
- Remove the unused imports from `core/tests/suite/unified_exec.rs`.
- Add `--print-failed-action-summary` to
`.github/scripts/run-bazel-ci.sh` so Bazel action failures can be
summarized after the build exits.

## Failure reporting

Once the coverage issue was fixed, an intentionally reintroduced unused
import made the Windows Bazel clippy job fail as expected. That exposed
a separate usability problem: because the job keeps `--keep_going`, the
top-level Bazel output could still end with:

```text
ERROR: Build did NOT complete successfully
FAILED:
```

without the underlying rustc/clippy diagnostic being visible in the
obvious part of the GitHub Actions log.

To keep `--keep_going` while making failures actionable, the wrapper now
scans the captured Bazel console output for failed actions and prints
the matching rustc/clippy diagnostic block. When a diagnostic block is
found, it is emitted both as a GitHub `::error` annotation and as plain
expanded log output, rather than being hidden in a collapsed group.

## Verification

To validate the CI path, I intentionally introduced an unused import in
`core/tests/suite/unified_exec.rs`. The Windows Bazel clippy job failed
as expected, confirming that the integration-test module is now covered
by Bazel clippy. The same failure also verified that the wrapper
surfaces the matching clippy diagnostics directly in the Actions output.
2026-04-17 18:19:58 +00:00
sayan-oai
6991be7ead enable tool search over dynamic tools (#18263)
## Summary

- Normalize deferred MCP and dynamic tools into `ToolSearchEntry` values
before constructing `ToolSearchHandler`.
- Move the tool-search entry adapter out of `tools/handlers` and into
`tools/tool_search_entry.rs` so the handlers directory stays focused on
handlers.
- Keep `ToolSearchHandler` operating over one generic entry list for
BM25 search, namespace grouping, and per-bucket default limits.

## Why

Follow-up cleanup for #17849. The dynamic tool-search support made the
handler juggle source-specific MCP and dynamic tool lists, index
arithmetic, output conversion, and namespace emission. This keeps source
adaptation outside the handler so the search loop itself is smaller and
source-agnostic.

## Validation

- `just fmt`
- `cargo test -p codex-core tools::handlers::tool_search::tests`
- `git diff --check`
- `cargo test -p codex-core` currently fails in unrelated
`plugins::manager::tests::list_marketplaces_ignores_installed_roots_missing_from_config`;
rerunning that single test fails the same way at
`core/src/plugins/manager_tests.rs:1692`.

---------

Co-authored-by: pash <pash@openai.com>
2026-04-18 02:07:59 +08:00
Michael Bolin
588c83cf1a merge commit for archive created by Sapling 2026-04-17 11:01:51 -07:00
Michael Bolin
65b1ae5612 fix: remove unused imports that got past CI 2026-04-17 11:01:39 -07:00
Michael Bolin
9ffe550c20 Merge d6e24719ca into sapling-pr-archive-bolinfest 2026-04-17 10:52:13 -07:00
Michael Bolin
d6e24719ca tests: isolate approval fixtures from host rules 2026-04-17 10:51:06 -07:00
Michael Bolin
752c140077 shell-escalation: carry resolved permission profiles 2026-04-17 10:51:06 -07:00
Michael Bolin
732d6ff614 mcp: include permission profiles in sandbox state 2026-04-17 10:51:05 -07:00
Michael Bolin
68a1513d4c tui: carry permission profiles on user turns 2026-04-17 10:51:05 -07:00
Michael Bolin
610ccd16d0 tui: sync session permission profiles 2026-04-17 10:51:05 -07:00
Michael Bolin
57c5742548 app-server: accept command permission profiles 2026-04-17 10:51:04 -07:00
Michael Bolin
fb79f87bac protocol: report session permission profiles 2026-04-17 10:51:04 -07:00
Michael Bolin
e2aa60f068 rollout: persist turn permission profiles 2026-04-17 10:49:24 -07:00
Michael Bolin
0164ac62c0 clients: send permission profiles to app-server 2026-04-17 10:49:24 -07:00
Michael Bolin
78e68a1290 app-server: accept permission profile overrides 2026-04-17 10:49:23 -07:00
Michael Bolin
d8c4ebdcda app-server: expose thread permission profiles 2026-04-17 10:49:23 -07:00
Michael Bolin
732143ef38 core: derive active permission profiles 2026-04-17 10:49:22 -07:00
Michael Bolin
b2781adbc4 exec-server: carry filesystem sandbox profiles 2026-04-17 10:48:55 -07:00
Michael Bolin
bf132de734 sandboxing: intersect permission profiles semantically 2026-04-17 10:47:50 -07:00
Michael Bolin
18fc17aeab protocol: canonicalize file system permissions 2026-04-17 10:47:50 -07:00
Michael Bolin
e9818a7b52 merge commit for archive created by Sapling 2026-04-17 10:43:21 -07:00
Michael Bolin
884349690f fix: remove unused imports that got past CI 2026-04-17 10:43:09 -07:00
Tom
fad3d0f1d0 codex: route thread/read persistence through thread store (#18352)
Summary
- replace the thread/read persisted-load helper with
ThreadStore::read_thread
- move SQLite/rollout summary, name, fork metadata, and history loading
for persisted reads into LocalThreadStore
- leave getConversationSummary unchanged for a later PR

Context
- Replaces closed stacked PR #18232 after PR #18231 merged and its base
branch was deleted.
2026-04-17 10:31:30 -07:00
Felipe Coury
d3692b14c9 feat(tui): add clear-context plan implementation (#17499)
## TL;DR

- Adds a second Plan Mode handoff: implement the approved plan after
clearing context.
- Keeps the existing same-thread `Yes, implement this plan` action
unchanged.
- Reuses the `/clear` thread-start path and submits the approved plan as
the fresh thread's first prompt.
- Covers the new popup option, event plumbing, initial-message behavior,
and disabled states in TUI tests.

## Problem

Plan Mode already asks whether to implement an approved plan, but the
only affirmative path continues in the same thread. That is useful when
the planning conversation itself is still valuable, but it does not
support the workflow where exploratory planning context is discarded and
implementation starts from the final approved plan as the only
model-visible handoff.

<img width="1253" height="869" alt="image"
src="https://github.com/user-attachments/assets/90023d75-c330-4919-bed8-518671c3474b"
/>

## Mental model

There are now two implementation choices after a proposed plan. The
existing choice, `Yes, implement this plan`, is unchanged: it switches
to Default mode and submits `Implement the plan.` in the current thread.
The new choice, `Yes, clear context and implement`, treats the proposed
plan as a handoff artifact. It clears the UI/session context through the
same thread-start source used by `/clear`, then submits an initial
prompt containing the approved plan after the fresh thread is
configured.

The important distinction is that the new path is not compaction. The
model receives a deliberate implementation prompt built from the
approved plan markdown, not a summary of the previous planning
transcript. Both implementation choices require the Default
collaboration preset to be available, so the popup does not offer a
coding handoff when the fresh thread would fall back to another mode.

## Non-goals

This change does not alter `/clear`, `/compact`, or the existing
same-context Plan Mode implementation option. It does not add protocol
surface area or app-server schema changes. It also does not carry the
previous transcript path or a generated planning summary into the new
model context.

## Tradeoffs

The fresh-context option relies on the approved plan being sufficiently
complete. That matches the Plan Mode contract, but it means vague plans
will produce weaker implementation starts than a compacted transcript
would. The upside is that rejected ideas, exploratory dead ends, and
planning corrections do not leak into the implementation turn.

The current implementation stores the latest proposed plan in
`ChatWidget` rather than deriving it from history cells at selection
time. This keeps the popup action simple and deterministic, but it makes
the cache lifecycle important: it must be reset when a new task starts
so an old plan cannot be submitted later.

## Architecture

The TUI stores the most recent completed proposed-plan markdown when a
plan item completes. The Plan Mode approval popup uses that cache to
enable the fresh-context option and to build a first-turn prompt that
instructs the model to implement the approved plan in a fresh context.

Selecting the new option emits a TUI-internal
`ClearUiAndSubmitUserMessage` event. `App` handles that event by reusing
the existing clear flow: clear terminal state, reset app UI state, start
a new app-server thread with `ThreadStartSource::Clear`, and attach a
replacement `ChatWidget` with an initial user message. The existing
initial-message suppression in `enqueue_primary_thread_session` ensures
the prompt is submitted only after the new session is configured and any
startup replay is rendered.

## Observability

The previous thread remains resumable through the existing clear-session
summary hint. There is no new telemetry or protocol event for this path,
so debugging should start at the TUI event boundary: confirm the popup
emitted `ClearUiAndSubmitUserMessage`, confirm the app-server thread
start used `ThreadStartSource::Clear`, then confirm the fresh widget
submitted the initial user message after `SessionConfigured`.

## Tests

The Plan Mode popup snapshots cover the new option and preserve the
original option as the first/default action. Unit coverage verifies the
original same-context option still emits `SubmitUserMessageWithMode`,
the new option emits `ClearUiAndSubmitUserMessage` with the approved
plan embedded verbatim, and the clear-context option is disabled when
Default mode is unavailable or no approved plan exists. The broader
`codex-tui` test package passes with the updated fresh-thread
initial-message plumbing.
2026-04-17 14:30:09 -03:00
colby-oai
ea84537369 Make app tool hint defaults pessimistic for app policies (#17232)
## Summary
- default missing app tool destructive/open-world hints to true for app
policies
- add regression tests for missing MCP annotations under restrictive app
config
2026-04-17 13:27:49 -04:00
jif-oai
cfc23eee3d feat: config aliases (#18140)
Rename `no_memories_if_mcp_or_web_search` →
`disable_on_external_context` with backward compatibility

While doing so, we add a key alias system on our layer merging system.
What we try to avoid is a case where a company managed config use an old
name while the user has a new name in it's local config (which would
make the deserialization fail)
2026-04-17 18:26:09 +01:00
Michael Bolin
523be6ae33 merge commit for archive created by Sapling 2026-04-17 10:20:50 -07:00
Michael Bolin
116a7f8112 fix: remove unused imports that got past CI 2026-04-17 10:20:38 -07:00
Michael Bolin
2c3f574d58 merge commit for archive created by Sapling 2026-04-17 10:08:12 -07:00
Michael Bolin
7f6b8d83fc tests: isolate approval fixtures from host rules 2026-04-17 10:07:49 -07:00
Michael Bolin
37139694a7 shell-escalation: carry resolved permission profiles 2026-04-17 10:07:49 -07:00
Michael Bolin
b9c66f7e39 mcp: include permission profiles in sandbox state 2026-04-17 10:07:49 -07:00