Commit cfc2b8b
fix(showcase): call ctx.log.info/.warn in hook bodies — sandbox ctx.log is an object
AuditTaskCompletion and WarnOverBudget guarded their log line with
`if (typeof ctx.log === 'function')`, but the sandboxed hook runtime installs
`ctx.log` as an object `{ info, warn, error }` (quickjs-runner installCtx /
ScriptContext.log), so the guard was always false and the lines were dead code.
Call the correct object-method API: `ctx.log.info(...)` for the audit hook and
`ctx.log.warn(...)` for the over-budget warning. Both already declare
capabilities: ['log'], so no capability change is needed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 524696a commit cfc2b8b
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments