mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
e68d546b11
## Summary Addresses all findings from 7-agent MSAL code review of the starter crash fix PRs (#3933, #3941, #3943). **Agent server (claude-sdk-typescript):** - Remove 6 unnecessary `as any` casts — use TypeScript discriminated union narrowing on `msg.role` - Add `ANTHROPIC_API_KEY` validation on startup (exit if missing) - Add `console.warn` logging to empty catch blocks (tool args + schema parse failures) - Sanitize error messages sent to client — no raw `err.message` in SSE stream - Fix misleading comment about system/developer role handling - Set explicit 2MB JSON body limit on Express - Remove unused `assistantMsgId` variable **Generation script:** - Remove dead `_agentDir` parameter from `rewritePythonImports` - Add warning when `PIN_OVERRIDES` dep not found in framework dependencies **Tests (3 new):** - Context-aware import rewriting for files inside `tools/` directory - `from agents.X import` relative import rewriting - `PIN_OVERRIDES` integration test for mastra version pinning ## Test plan - [x] 254 generate-starters tests pass (3 new) - [x] Drift check passes - [x] Pre-commit hooks pass