Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/runtime/src/__tests__/ai-sdk-backend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9316,6 +9316,11 @@ describe('AiSdkBackend RunTrace', () => {
request: { messages: [] },
continuation: 'none',
}),
toolCallSafety: Promise.resolve({
hadRawArgumentEvidence: false,
proofs: new Map(),
atomicProofs: new Map(),
}),
};
};

Expand Down Expand Up @@ -12007,6 +12012,11 @@ describe('AiSdkBackend thinking persistence', () => {
request: { messages: [] },
continuation: 'none',
}),
toolCallSafety: Promise.resolve({
hadRawArgumentEvidence: false,
proofs: new Map(),
atomicProofs: new Map(),
}),
});

for await (const event of backend.send({ turnId: 'turn-1', text: 'hi', context: [] })) {
Expand Down
26 changes: 25 additions & 1 deletion packages/runtime/src/__tests__/deferred-guard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,31 @@ describe('tool-availability execute-boundary guard', () => {
test('keeps WriteStdin args exact across canonical ledgers and projects telemetry', async () => {
const h = makeHarness();
const implCalls: string[] = [];
const t = tool('WriteStdin', implCalls);
// The real WriteStdin tool (shell-tools.ts, buildWriteStdinTool) declares
// a heavyweight z.preprocess/refine schema enforcing PTY-specific business
// rules (ref format, input byte length, well-formed Unicode, ...) that
// this test has nothing to do with. `tool()`'s shared z.object({}) is
// wrong here for a different reason: ToolRuntime now executes the
// schema's own parsed value (see tool-runtime.ts), and an empty schema
// strips every key, which used to be masked only because the pre-fix
// ToolRuntime discarded that parsed value and executed the raw input
// instead. A schema matching WriteStdin's real field names, with no
// business-rule refinements, is what this test actually needs: proof
// that already-valid args pass through Runtime's plumbing unchanged, not
// a reproduction of WriteStdin's own validation.
const t: MakaTool = {
name: 'WriteStdin',
description: 'WriteStdin',
parameters: z.object({
ref: z.string(),
input: z.string(),
size: z.object({ cols: z.number(), rows: z.number() }),
}),
impl: () => {
implCalls.push('WriteStdin');
return { ok: true };
},
};
const args = {
ref: 'maka://runtime/background-tasks/pty-1',
input: 'password=ordinary-audited-input\r',
Expand Down
Loading