Repository navigation
Conversation
Greptile SummaryThis PR improves the operator-facing warning when a tool allowlist references core tools that are valid in the built-in profile but not available in the active per-turn runtime, preventing misleading "unknown entries" messages for tools like Key changes:
Issue found:
Confidence Score: 4/5
Last reviewed commit: 6314510 |
| if (resolved.unavailableCoreAllowlist.length > 0) { | ||
| const entries = resolved.unavailableCoreAllowlist.join(", "); | ||
| params.warn( | ||
| `tools: ${step.label} allowlist includes known tools unavailable in this runtime context (${entries}).`, | ||
| ); | ||
| } |
There was a problem hiding this comment.
Stripping not surfaced when allowlist contains only unavailable core tools
When the entire allowlist consists of known-but-unavailable core tools (e.g. allow: ["apply_patch", "cron"] with no active core tool present in the runtime), two things happen simultaneously:
unavailableCoreAllowlistis populated → the new warning is emitted.hasCoreEntrystaysfalse→strippedAllowlist = true→policy.allowis set toundefined.
However, because unknownAllowlist is empty in this case, the second if block is never reached and its "Ignoring allowlist so core tools remain available. Use tools.alsoAllow for additive plugin tool enablement." suffix is never printed.
Before this PR, those same entries fell into unknownAllowlist, so the existing warning already mentioned the stripping. After the PR, an operator whose allowlist contains only unavailable core tools now gets a warning about the unavailable tools but no indication that the whole allowlist has been silently dropped.
Consider checking resolved.strippedAllowlist inside the new block and appending the stripping notice when applicable:
| if (resolved.unavailableCoreAllowlist.length > 0) { | |
| const entries = resolved.unavailableCoreAllowlist.join(", "); | |
| params.warn( | |
| `tools: ${step.label} allowlist includes known tools unavailable in this runtime context (${entries}).`, | |
| ); | |
| } | |
| if (resolved.unavailableCoreAllowlist.length > 0) { | |
| const entries = resolved.unavailableCoreAllowlist.join(", "); | |
| const suffix = resolved.strippedAllowlist | |
| ? " Ignoring allowlist so core tools remain available. Use tools.alsoAllow for additive plugin tool enablement." | |
| : ""; | |
| params.warn( | |
| `tools: ${step.label} allowlist includes known tools unavailable in this runtime context (${entries}).${suffix}`, | |
| ); | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/tool-policy-pipeline.ts
Line: 92-97
Comment:
**Stripping not surfaced when allowlist contains only unavailable core tools**
When the entire allowlist consists of known-but-unavailable core tools (e.g. `allow: ["apply_patch", "cron"]` with no active core tool present in the runtime), two things happen simultaneously:
1. `unavailableCoreAllowlist` is populated → the new warning is emitted.
2. `hasCoreEntry` stays `false` → `strippedAllowlist = true` → `policy.allow` is set to `undefined`.
However, because `unknownAllowlist` is empty in this case, the second `if` block is never reached and its "Ignoring allowlist so core tools remain available. Use `tools.alsoAllow` for additive plugin tool enablement." suffix is never printed.
Before this PR, those same entries fell into `unknownAllowlist`, so the existing warning already mentioned the stripping. After the PR, an operator whose allowlist contains **only** unavailable core tools now gets a warning about the unavailable tools but no indication that the whole allowlist has been silently dropped.
Consider checking `resolved.strippedAllowlist` inside the new block and appending the stripping notice when applicable:
```suggestion
if (resolved.unavailableCoreAllowlist.length > 0) {
const entries = resolved.unavailableCoreAllowlist.join(", ");
const suffix = resolved.strippedAllowlist
? " Ignoring allowlist so core tools remain available. Use tools.alsoAllow for additive plugin tool enablement."
: "";
params.warn(
`tools: ${step.label} allowlist includes known tools unavailable in this runtime context (${entries}).${suffix}`,
);
}
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6314510803
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!isCoreEntry && isKnownCoreEntry) { | ||
| unavailableCoreAllowlist.push(entry); | ||
| continue; |
There was a problem hiding this comment.
Preserve plugin matches before marking entries unavailable
If an allowlist entry is both a plugin tool and a known core id (for example, a plugin exposes apply_patch while the built-in apply_patch is unavailable in this runtime), this branch classifies it as unavailableCoreAllowlist and exits early even though isPluginEntry is true. That produces a misleading runtime warning and hides the plugin/unknown-entry guidance for that item, which can send operators toward the wrong fix path in mixed core+plugin deployments.
Useful? React with 👍 / 👎.
|
Addressed the diagnostic gap Greptile called out. What changed:
Validation:
The update is in |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing this as implemented after Codex review. Current What I checked:
So I’m closing this as already implemented rather than keeping a duplicate issue open. Review notes: reviewed against 84fc00afdacb; fix evidence: commit 84fc00afdacb. |
Summary
Improve tool-policy warnings so known core tools that are missing from the active runtime toolset are not reported as
unknown entries.Previously,
tools.profile (coding)could log warnings like:allowlist contains unknown entries (apply_patch, cron)That was misleading when
apply_patchandcronwere valid built-in tools in thecodingprofile but unavailable in the specific runtime context for a turn.What changed
stripPluginOnlyAllowlist()to distinguish:allowlist includes known tools unavailable in this runtime context (...)Why
This warning sends operators toward the wrong root cause. The config and built-in profile can be correct even when the per-turn active toolset omits some tools.
Testing
corepack pnpm exec vitest run src/agents/tool-policy.plugin-only-allowlist.test.ts src/agents/tool-policy-pipeline.test.tscorepack pnpm exec tsc -p tsconfig.json --noEmit --pretty false(fails in this checkout due unrelated missing extension deps:@pierre/diffs,@tloncorp/api)