mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
fix(codex): omit discovery and delegation guidance for empty tool allowlists (#160840)
This commit is contained in:
parent
a6bc0f03b3
commit
2b8bee9583
2 changed files with 10 additions and 0 deletions
|
|
@ -153,6 +153,15 @@ describe("buildDeveloperInstructions credential routing", () => {
|
|||
});
|
||||
|
||||
describe("buildDeveloperInstructions delegation guidance", () => {
|
||||
it("omits discovery and delegation guidance for an explicitly empty tool allowlist", () => {
|
||||
const params = createParams({ toolsAllow: [] });
|
||||
const instructions = buildDeveloperInstructions(params);
|
||||
|
||||
expect(instructions).not.toContain("ALL_TOOLS");
|
||||
expect(instructions).not.toContain("spawn_agent");
|
||||
expect(buildDeveloperInstructions({ ...params, toolsAllow: undefined })).toContain("ALL_TOOLS");
|
||||
});
|
||||
|
||||
it("shares the visible-session delegation policy with a canonical main session", () => {
|
||||
const instructions = buildInstructions();
|
||||
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ export function buildDeveloperInstructions(
|
|||
}).join("\n");
|
||||
const delegationGuidanceAvailable =
|
||||
params.disableTools !== true &&
|
||||
params.toolsAllow?.length !== 0 &&
|
||||
params.delegationCapability !== "report_only" &&
|
||||
!isMessageOnlyCodexSourceReply(params);
|
||||
const nativeDelegationAvailable =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue