Skip to content

Comments

feat: consolidate sync messaging and model-mapping from PRs #239 and #240#271

Merged
khaliqgant merged 3 commits intomainfrom
feature/pr-consolidation-239-240
Jan 23, 2026
Merged

feat: consolidate sync messaging and model-mapping from PRs #239 and #240#271
khaliqgant merged 3 commits intomainfrom
feature/pr-consolidation-239-240

Conversation

@khaliqgant
Copy link
Collaborator

@khaliqgant khaliqgant commented Jan 23, 2026

Summary

Consolidates key improvements from stabilization PRs that were created before the package refactor:

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

Why 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

  • TypeScript compilation passes
  • All client tests pass (35 tests)
  • Build completes successfully

🤖 Generated with Claude Code


Open with Devin

…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-pr-review
Copy link

my-senior-dev-pr-review bot commented Jan 23, 2026

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

📁 Expert in src (495 edits) • ⚡ 126th PR this month

View your contributor analytics →


📊 16 files reviewed • 1 need attention

🚨 High Risk:

  • deploy/workspace/Dockerfile — Modifies build steps which can affect deployment and security posture.
  • deploy/workspace/Dockerfile — Changes introduce potential issues if not managed correctly and alterations to behavior and structure of backend logic.

⚠️ Needs Attention:

  • deploy/workspace/Dockerfile — Changes to Dockerfile enhance clarity but involve build processes that can affect deployment workflow.

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Truthy checks like if (ack.response) will pass for both 'OK' and 'ERROR' strings
  2. Strict equality checks like if (ack.response === true) will fail even for successful responses
  3. 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.

Open in Devin Review

khaliqgant and others added 2 commits January 23, 2026 11:34
- 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>
@khaliqgant khaliqgant merged commit 7354c82 into main Jan 23, 2026
17 of 21 checks passed
@khaliqgant khaliqgant deleted the feature/pr-consolidation-239-240 branch January 23, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant