Add more builtin providers, refactor apply_patch tools and tool injections - #76
Conversation
Signed-off-by: masteryyh <yyh991013@163.com>
Signed-off-by: masteryyh <yyh991013@163.com>
Signed-off-by: masteryyh <yyh991013@163.com>
Signed-off-by: masteryyh <yyh991013@163.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 819a2470b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: masteryyh <yyh991013@163.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10d3779b5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: masteryyh <yyh991013@163.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b8f8135af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: masteryyh <yyh991013@163.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b4456c18a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: masteryyh <yyh991013@163.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27dd55a7fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: masteryyh <yyh991013@163.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66a01ede5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut output = OpenOptions::new() | ||
| .write(true) | ||
| .create_new(true) | ||
| .open(&temp)?; | ||
| output.write_all(&file.data)?; | ||
| output.flush()?; | ||
| set_mode(&output, file.mode)?; |
There was a problem hiding this comment.
Preserve file metadata when staging replacements
When an existing file has ACLs, extended attributes such as SELinux labels or quarantine metadata, or ownership that differs from the helper process, this creates a new inode containing only the original bytes and Unix mode before renaming it over the target. The update therefore silently discards the remaining metadata, whereas the replaced os.WriteFile implementation modified the existing inode; copy the relevant metadata to the staged file before installation. Meow.
Useful? React with 👍 / 👎.
Signed-off-by: masteryyh <yyh991013@163.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9337378e30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| models := make([]catalog.AvailableModel, 0, len(response.Data)) | ||
| for index, item := range response.Data { |
There was a problem hiding this comment.
Filter non-generation OpenAI models from discovery
When a custom OpenAI-compatible /models endpoint returns embedding-only, image, audio, or other non-chat entries, this loop normalizes and exposes every item as a selectable generation model. The setup flow can then complete with an embedding model because no capability marker reaches initialization, but every session request subsequently fails against the Responses or Chat Completions API. Filter entries using provider capability metadata, or avoid offering models whose generation capability cannot be established.
AGENTS.md reference: AGENTS.md:L31-L34
Useful? React with 👍 / 👎.
| if (model.source === "cached") { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Persist a discovered model when selecting it as default
When the user selects a cached model from a custom provider, this branch skips persisting that model but later saves the agent with an exact reference to it. Because the discovery cache is only in memory, restarting core leaves the provider JSON without that model; preparing the agent then requires successful network rediscovery and fails with model not found while offline or when the listing endpoint is unavailable. Keep untouched discovered entries transient, but persist the selected default model before completing setup. Meow.
AGENTS.md reference: AGENTS.md:L44-L51
Useful? React with 👍 / 👎.
Signed-off-by: masteryyh <yyh991013@163.com>
Signed-off-by: masteryyh <yyh991013@163.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba57b6b8de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if outputReservedWindow < safetyWindow { | ||
| return max(0, outputReservedWindow) |
There was a problem hiding this comment.
Leave room for the hidden compaction prompt
For models where the output reserve determines this threshold, such as a 200k-context/64k-output model, compaction starts when the estimated request reaches 136k tokens, but invokeCompaction then appends the hidden <session-compaction-request> while retaining the 64k output allowance. The resulting compaction request itself exceeds the context window and can be rejected, preventing long sessions from compacting. Fresh evidence beyond the earlier threshold finding is that the corrected threshold reserves exactly the output budget but still does not reserve the subsequently appended instruction; subtract its estimate or reduce the compaction output allowance.
Useful? React with 👍 / 👎.
| if metadata.file_type().is_symlink() { | ||
| return Ok(FileSnapshot { | ||
| kind: EntryKind::Symlink, | ||
| data: Vec::new(), | ||
| mode, |
There was a problem hiding this comment.
Snapshot symlink targets before revalidation
When a delete targets a symlink and another process retargets that link during the shared-to-exclusive lock handoff, both snapshots contain only Symlink, the mode, and empty data. The commit-time equality check therefore accepts the changed link and deletes it instead of reporting that the target changed; include read_link data in the snapshot so revalidation distinguishes different link targets. Meow.
Useful? React with 👍 / 👎.
No description provided.