Skip to content

Commit c0c5ee6

Browse files
committed
test(system-agent): assert config secrecy invariant
1 parent cc37775 commit c0c5ee6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/system-agent/chat-turn-router.approval.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,24 +914,26 @@ describe("SystemAgentChatEngine approval", () => {
914914
"config set gateway.auth.token.abcDEF123 please",
915915
'config set channels.synology-chat.accounts["prod.guild"].webhookUrl.abcDEF123 please',
916916
])(
917-
"redacts sensitive dynamic or unknown-owner path %s from approvals and history",
917+
"keeps sensitive dynamic or unknown-owner path %s out of model paths, responses, and history",
918918
async (command) => {
919919
const planner = vi.fn(
920920
async (_params: { history?: Array<{ role: string; text: string }> }) => ({
921921
reply: "noted",
922922
}),
923923
);
924+
const runAgentTurn = vi.fn(async () => null);
924925
const engine = new SystemAgentChatEngine({
925-
runAgentTurn: async () => null,
926+
runAgentTurn,
926927
planWithAssistant: planner as never,
927928
classifyApproval: async () => "other",
928929
deps: { loadOverview: fakeOverviewLoader() },
929930
});
930931

931932
const proposed = await engine.handle(command);
932-
expect(proposed.text).toContain("<redacted path>");
933933
expect(proposed.text).not.toContain("abcDEF123");
934934
expect(proposed.text).not.toContain("Bearer-abc");
935+
expect(runAgentTurn).not.toHaveBeenCalled();
936+
expect(planner).not.toHaveBeenCalled();
935937

936938
await engine.handle("no");
937939
await engine.handle("did that work?");

0 commit comments

Comments
 (0)