Mohamed Boudra 7b649eb77f feat: add centralized mode validation for agent providers
Prevents server crashes when invalid modes are passed to agents by
validating mode IDs before attempting to set them on the SDK.

- Export VALID_CLAUDE_MODES and VALID_CODEX_MODES from provider files
- Add validateMode() function in agent-manager.ts
- Apply validation in createAgent(), resumeAgent(), and setAgentMode()
- Throws clear error listing valid modes when validation fails

This fixes the crash when 'read-only' (Codex mode) was passed to
a Claude agent.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 20:03:38 +07:00
Description
Languages
TypeScript 98.1%
JavaScript 1.3%
Shell 0.1%
Swift 0.1%