core-agent-ide/codex-rs/app-server/tests/suite
Owen Lin 66450f0445
fix: implement 'Allow this session' for apply_patch approvals (#8451)
**Summary**
This PR makes “ApprovalDecision::AcceptForSession / don’t ask again this
session” actually work for `apply_patch` approvals by caching approvals
based on absolute file paths in codex-core, properly wiring it through
app-server v2, and exposing the choice in both TUI and TUI2.
- This brings `apply_patch` calls to be at feature-parity with general
shell commands, which also have a "Yes, and don't ask again" option.
- This also fixes VSCE's "Allow this session" button to actually work.

While we're at it, also split the app-server v2 protocol's
`ApprovalDecision` enum so execpolicy amendments are only available for
command execution approvals.

**Key changes**
- Core: per-session patch approval allowlist keyed by absolute file
paths
- Handles multi-file patches and renames/moves by recording both source
and destination paths for `Update { move_path: Some(...) }`.
- Extend the `Approvable` trait and `ApplyPatchRuntime` to work with
multiple keys, because an `apply_patch` tool call can modify multiple
files. For a request to be auto-approved, we will need to check that all
file paths have been approved previously.
- App-server v2: honor AcceptForSession for file changes
- File-change approval responses now map AcceptForSession to
ReviewDecision::ApprovedForSession (no longer downgraded to plain
Approved).
- Replace `ApprovalDecision` with two enums:
`CommandExecutionApprovalDecision` and `FileChangeApprovalDecision`
- TUI / TUI2: expose “don’t ask again for these files this session”
- Patch approval overlays now include a third option (“Yes, and don’t
ask again for these files this session (s)”).
    - Snapshot updates for the approval modal.

**Tests added/updated**
- Core:
- Integration test that proves ApprovedForSession on a patch skips the
next patch prompt for the same file
- App-server:
- v2 integration test verifying
FileChangeApprovalDecision::AcceptForSession works properly

**User-visible behavior**
- When the user approves a patch “for session”, future patches touching
only those previously approved file(s) will no longer prompt gain during
that session (both via app-server v2 and TUI/TUI2).

**Manual testing**
Tested both TUI and TUI2 - see screenshots below.

TUI:
<img width="1082" height="355" alt="image"
src="https://github.com/user-attachments/assets/adcf45ad-d428-498d-92fc-1a0a420878d9"
/>


TUI2:
<img width="1089" height="438" alt="image"
src="https://github.com/user-attachments/assets/dd768b1a-2f5f-4bd6-98fd-e52c1d3abd9e"
/>
2026-01-07 20:11:12 +00:00
..
v2 fix: implement 'Allow this session' for apply_patch approvals (#8451) 2026-01-07 20:11:12 +00:00
archive_thread.rs chore: unify conversation with thread name (#8830) 2026-01-07 17:04:53 +00:00
auth.rs chore: use anyhow::Result for all app-server integration tests (#5836) 2025-10-28 08:10:23 -07:00
codex_message_processor_flow.rs chore: unify conversation with thread name (#8830) 2026-01-07 17:04:53 +00:00
config.rs fix: added test helpers for platform-specific paths (#7954) 2025-12-13 00:14:12 +00:00
create_thread.rs chore: unify conversation with thread name (#8830) 2026-01-07 17:04:53 +00:00
fuzzy_file_search.rs chore: use anyhow::Result for all app-server integration tests (#5836) 2025-10-28 08:10:23 -07:00
interrupt.rs Migrate coverage to shell_command (#7042) 2025-11-21 03:44:00 +00:00
list_resume.rs chore: unify conversation with thread name (#8830) 2026-01-07 17:04:53 +00:00
login.rs [app-server] make app server not throw error when login id is not found (#7831) 2025-12-10 16:19:40 -08:00
mod.rs chore: unify conversation with thread name (#8830) 2026-01-07 17:04:53 +00:00
output_schema.rs feat: expose outputSchema to user_turn/turn_start app_server API (#8377) 2026-01-05 10:27:00 -08:00
send_message.rs chore: unify conversation with thread name (#8830) 2026-01-07 17:04:53 +00:00
set_default_model.rs feat: arcticfox in the wild (#6906) 2025-11-19 16:31:06 +00:00
user_agent.rs feat: change ConfigLayerName into a disjoint union rather than a simple enum (#8095) 2025-12-17 08:13:59 -08:00
user_info.rs chore: use anyhow::Result for all app-server integration tests (#5836) 2025-10-28 08:10:23 -07:00