Commit Graph

1736 Commits

Author SHA1 Message Date
kevin zhao
4e1ba60c6b fix rebase 2025-12-02 22:42:48 +00:00
kevin zhao
acc7c999fb fix test 2025-12-02 22:42:48 +00:00
kevin zhao
88e7a3aca4 remove unecessary import 2025-12-02 22:42:48 +00:00
kevin zhao
cac03d5e6b simplify approval overlay logic 2025-12-02 22:42:48 +00:00
kevin zhao
28daeaeec0 delete weird test 2025-12-02 22:42:48 +00:00
kevin zhao
1d14bc51e8 inlining and cleanup tests 2025-12-02 22:42:48 +00:00
kevin zhao
bf897bf45d inlining 2025-12-02 22:42:48 +00:00
kevin zhao
3e570a8824 update messaging 2025-12-02 22:42:48 +00:00
kevin zhao
ba34d0ca96 cleanup forbidden messaging 2025-12-02 22:42:48 +00:00
kevin zhao
a13ca36702 delete useless comment 2025-12-02 22:42:48 +00:00
kevin zhao
7edc990705 improve messaging 2025-12-02 22:42:48 +00:00
kevin zhao
a91a00e8a7 feat: integrating heuristics-based fallback in execpolicy 2025-12-02 22:42:48 +00:00
kevin zhao
a69bd729db improved behavior for dont ask again for this prefix 2025-12-02 22:42:48 +00:00
kevin zhao
338ec43a3a fix rebase bug 2025-12-02 17:42:25 -05:00
kevin zhao
a10a775ad7 add docstring 2025-12-02 17:38:52 -05:00
kevin zhao
ecf0f163c6 docs 2025-12-02 17:38:52 -05:00
kevin zhao
d6e85f9325 only cloning when needed 2025-12-02 17:38:52 -05:00
kevin zhao
3460d33d66 fix approvals test 2025-12-02 17:38:52 -05:00
kevin zhao
bfe5b194ca fix formatting 2025-12-02 17:38:52 -05:00
kevin zhao
3dc54e6bce fixup allow_prefix_if_applicable 2025-12-02 17:38:51 -05:00
kevin zhao
d2e5d40762 running test with single thread 2025-12-02 17:38:51 -05:00
kevin zhao
08a85a07fd fix compile error 2025-12-02 17:38:51 -05:00
kevin zhao
00bd765957 fix flaky test 2025-12-02 17:38:51 -05:00
kevin zhao
a610663a36 fix compile 2025-12-02 17:38:51 -05:00
kevin zhao
48e424c7d4 . 2025-12-02 17:38:51 -05:00
kevin zhao
4a9089294f integration test 2025-12-02 17:38:50 -05:00
kevin zhao
b3d8a7cd38 updating phrasing 2025-12-02 17:38:50 -05:00
kevin zhao
945074d6f0 fixing rw lock bug causing tui to hang 2025-12-02 17:38:50 -05:00
kevin zhao
dc901ff21a undo diff 2025-12-02 17:38:50 -05:00
kevin zhao
d67b1f7d32 cleanup exec_policy getters 2025-12-02 17:38:50 -05:00
kevin zhao
aa3c4d3d1f moving args around 2025-12-02 17:38:50 -05:00
kevin zhao
d747d1d492 do not send allow_prefix if execpolicy is disabled 2025-12-02 17:38:49 -05:00
kevin zhao
2a4e833e91 fmt 2025-12-02 17:38:49 -05:00
kevin zhao
02c66be831 refactor: adding allow_prefix into ApprovedAllowPrefix 2025-12-02 17:38:49 -05:00
kevin zhao
d4d293fcf0 clippy 2025-12-02 17:38:49 -05:00
kevin zhao
a2528c3675 using RW locks 2025-12-02 17:38:49 -05:00
kevin zhao
8fb06a9d5b mutating in memory policy instead of reloading 2025-12-02 17:38:49 -05:00
kevin zhao
ea9fc79dec Add explicit prefix-approval decision and wire it through execpolicy/UI snapshots 2025-12-02 17:38:48 -05:00
kevin zhao
80e3635b25 Add approval allow-prefix flow in core and tui 2025-12-02 17:38:48 -05:00
liam
4d4778ec1c Trim history.jsonl when history.max_bytes is set (#6242)
This PR honors the `history.max_bytes` configuration parameter by
trimming `history.jsonl` whenever it grows past the configured limit.
While appending new entries we retain the newest record, drop the oldest
lines to stay within the byte budget, and serialize the compacted file
back to disk under the same lock to keep writers safe.
2025-12-02 14:01:05 -08:00
Owen Lin
77c457121e fix: remove serde(flatten) annotation for TurnError (#7499)
The problem with using `serde(flatten)` on Turn status is that it
conditionally serializes the `error` field, which is not the pattern we
want in API v2 where all fields on an object should always be returned.

```
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct Turn {
    pub id: String,
    /// Only populated on a `thread/resume` response.
    /// For all other responses and notifications returning a Turn,
    /// the items field will be an empty list.
    pub items: Vec<ThreadItem>,
    #[serde(flatten)]
    pub status: TurnStatus,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(tag = "status", rename_all = "camelCase")]
#[ts(tag = "status", export_to = "v2/")]
pub enum TurnStatus {
    Completed,
    Interrupted,
    Failed { error: TurnError },
    InProgress,
}
```

serializes to:
```
{
  "id": "turn-123",
  "items": [],
  "status": "completed"
}

{
  "id": "turn-123",
  "items": [],
  "status": "failed",
  "error": {
    "message": "Tool timeout",
    "codexErrorInfo": null
  }
}
```

Instead we want:
```
{
  "id": "turn-123",
  "items": [],
  "status": "completed",
  "error": null
}

{
  "id": "turn-123",
  "items": [],
  "status": "failed",
  "error": {
    "message": "Tool timeout",
    "codexErrorInfo": null
  }
}
```
2025-12-02 21:39:10 +00:00
zhao-oai
5ebdc9af1b persisting credits if new snapshot does not contain credit info (#7490)
in response to incoming changes to responses headers where the header
may sometimes not contain credits info (no longer forcing a credit
check)
2025-12-02 16:23:24 -05:00
Michael Bolin
f6a7da4ac3 fix: drop lock once it is no longer needed (#7500)
I noticed this while doing a post-commit review of https://github.com/openai/codex/pull/7467.
2025-12-02 20:46:26 +00:00
zhao-oai
1d09ac89a1 execpolicy helpers (#7032)
this PR 
- adds a helper function to amend `.codexpolicy` files with new prefix
rules
- adds a utility to `Policy` allowing prefix rules to be added to
existing `Policy` structs

both additions will be helpful as we thread codexpolicy into the TUI
workflow
2025-12-02 15:05:27 -05:00
Ahmed Ibrahim
127e307f89 Show token used when context window is unknown (#7497)
- Show context window usage in tokens instead of percentage when the
window length is unknown.
2025-12-02 11:45:50 -08:00
Ahmed Ibrahim
21ad1c1c90 Use non-blocking mutex (#7467) 2025-12-02 10:50:46 -08:00
lionel-oai
349734e38d Fix: track only untracked paths in ghost snapshots (#7470)
# Ghost snapshot ignores

This PR should close #7067, #7395, #7405.

Prior to this change the ghost snapshot task ran `git status
--ignored=matching` so the report picked up literally every ignored
file. When a directory only contained entries matched by patterns such
as `dozens/*.txt`, `/test123/generated/*.html`, or `/wp-includes/*`, Git
still enumerated them and the large-untracked-dir detection treated the
parent directory as “large,” even though everything inside was
intentionally ignored.

By removing `--ignored=matching` we only capture true untracked paths
now, so those patterns stay out of the snapshot report and no longer
trigger the “large untracked directories” warning.

---------

Signed-off-by: lionelchg <lionel.cheng@hotmail.fr>
Co-authored-by: lionelchg <lionel.cheng@hotmail.fr>
2025-12-02 19:42:33 +01:00
jif-oai
2222cab9ea feat: ignore standard directories (#7483) 2025-12-02 18:42:07 +00:00
Owen Lin
c2f8c4e9f4 fix: add ts number annotations for app-server v2 types (#7492)
These will be more ergonomic to work with in Typescript.
2025-12-02 18:09:41 +00:00
jif-oai
72b95db12f feat: intercept apply_patch for unified_exec (#7446) 2025-12-02 17:54:02 +00:00