fix: build config, runtime safety, and coverage thresholds#97
Conversation
64e2221 to
1a1baf5
Compare
|
Hi @Misaka477, thanks for the comprehensive fixes. This PR overlaps with #28 on adding @step-cli/agent-sdk to the build pipeline (scripts/build-packages.mjs). #28 is currently open and covers the same change. Wanted to flag the overlap in case you want to coordinate or consolidate. |
1a1baf5 to
8f44d18
Compare
|
Thanks for the heads-up! I've removed the agent-sdk build change from this PR to avoid overlap with #28. This PR now focuses only on the runtime fixes (executionProfile, token budget, hooks, checkpoint, retry signal, configurable params, coverage thresholds). |
|
B3(
两个不卡合入的提醒:B6 给 hook 加了 流程上:测试矩阵没跑是首次贡献者 workflow 需要维护者批准,不是你的问题;修完 push,我们来批。注意本 PR 与 #98 在 |
Summary
Seven fixes across build config, runtime safety, and coverage infrastructure.
Changes
B1: @step-cli/agent-sdk in buildTargets — adds agent-sdk to
scripts/build-packages.mjssopnpm build:packagesproducesdist/.B3: executionProfile null guard — adds optional chaining to
context?.executionProfile?.workspaceModein bothagent-loop.tsandstate-machine.ts.B4: negative token budget —
computeStepMaxTokensreturns 0 whenremainingBudget <= 0, preventing forced output with no context space.B6: hook error handling — wraps
onToolStartandonToolResulthooks in try-catch with fallback logging.B7: checkpoint failure logging — adds explicit WARNING log entry when checkpoint persistence fails.
B15: retry signal leak — creates a fresh
AbortSignal.any()per retry attempt so listeners don't accumulate on a shared signal.B16/B17: configurable params — makes
AgentStateMachine.maxTimelineSizea constructor parameter; addsretryDelayBase/retryDelayMax/retryDelayJittertoAgentRunConfig.B18: per-module coverage thresholds — adds module-specific thresholds in
vitest.config.tsfor high-risk areas (core/agent, core/tools, realtime).Verification
tsc --noEmit✅pnpm lint✅ (0 errors)pnpm test✅ (1474 passed, 8 skipped)pnpm dep-graph-check✅Closes #83, Closes #84, Closes #86, Closes #87, Closes #94