feat: consolidate sync messaging and model-mapping from PRs #239 and #240#271
feat: consolidate sync messaging and model-mapping from PRs #239 and #240#271khaliqgant merged 3 commits intomainfrom
Conversation
…240 Cherry-pick key improvements from stabilization PRs: From #239 (sync messaging protocol): - Change AckPayload.response from boolean to string for richer status codes ('OK', 'ERROR', 'ACCEPTED', etc.) - Add JSDoc documentation for sync messaging fields - Update all call sites to use string values From #240 (model selection): - Add model-mapping utility for mapping agent profile models to CLI variants - Enable cost tracking and model selection per agent - Integrate mapModelToCli() into spawner for automatic CLI variant selection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 My Senior Dev — Analysis Complete👤 For @khaliqgant📁 Expert in View your contributor analytics → 📊 16 files reviewed • 1 need attention 🚨 High Risk:
🚀 Open Interactive Review →The full interface unlocks features not available in GitHub:
💬 Chat here: 📖 View all 12 personas & slash commandsYou can interact with me by mentioning In PR comments or on any line of code:
Slash commands:
AI Personas (mention to get their perspective):
For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews. |
There was a problem hiding this comment.
Devin Review found 1 potential issue.
🔴 1 issue in files not directly in the diff
🔴 Type mismatch: AckPayload.response is string in protocol package but boolean in SDK package (packages/sdk/src/protocol/types.ts:182)
The PR changes AckPayload.response from boolean to string in packages/protocol/src/types.ts but does not update the corresponding type in packages/sdk/src/protocol/types.ts, which still defines it as response?: boolean.
Click to expand
Inconsistent Type Definitions
The protocol package (packages/protocol/src/types.ts:189) now has:
response?: string;But the SDK package (packages/sdk/src/protocol/types.ts:182) still has:
response?: boolean;Impact
The SDK is a public-facing package that external consumers use. When the daemon or wrapper sends an ACK with response: 'OK' or response: 'ERROR' (strings), SDK consumers expecting a boolean will get unexpected behavior:
- Truthy checks like
if (ack.response)will pass for both'OK'and'ERROR'strings - Strict equality checks like
if (ack.response === true)will fail even for successful responses - TypeScript consumers will have incorrect type information
The test files were updated to use string values (response: 'OK'), which will cause TypeScript compilation errors when building the SDK package since the type expects boolean.
Recommendation: Update the SDK's AckPayload.response type from boolean to string to match the protocol package, and add the same JSDoc documentation.
View issue and 4 additional flags in Devin Review.
- Sync AckPayload.response type in SDK package (was still boolean) - Remove unused getBaseCli import from spawner - Add comprehensive unit tests for model-mapping utility (26 tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Consolidates key improvements from stabilization PRs that were created before the package refactor:
From #239 (sync messaging protocol)
AckPayload.responsefrombooleantostringfor richer status codes ('OK', 'ERROR', 'ACCEPTED', etc.)From #240 (model selection)
model-mappingutility for mapping agent profile models to CLI variantsmapModelToCli()into spawner for automatic CLI variant selectionWhy This PR
PRs #243, #244, #245 were superseded during the refactor - the sync messaging features they added are already implemented in the new package structure. This PR brings in the remaining valuable pieces from #239 and #240 that weren't already merged.
Closes
This PR incorporates relevant changes from:
After merging, the following PRs should be closed as superseded:
Test plan
🤖 Generated with Claude Code