fix(core): /setproject writes to conversation DB id, not platform id#1937
fix(core): /setproject writes to conversation DB id, not platform id#1937aryrabelo wants to merge 1 commit into
Conversation
handleSetProject passed the platform conversation id (Telegram chat id, GitHub owner/repo#n) straight to updateConversation, which keys on the conversations-table primary key. On every platform where the DB id differs from the platform id the UPDATE matched 0 rows and threw "Conversation not found: <platform-id>", so /setproject never bound the codebase to the conversation. Pass conversation.id (the DB primary key) instead, mirroring every other updateConversation call site in the orchestrator. Add a regression test where the DB id differs from the platform conversation id.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR fixes a bug where the ChangesOrchestrator /setproject DB ID Fix
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
/setproject <name>failed withError: Conversation not found: <id>on Telegram (and any platform where the conversations-table primary key differs from the platform conversation id).handleSetProjectnow passesconversation.id(the DB primary key) toupdateConversationinstead of the raw platformconversationId. Added a regression test where the DB id differs from the platform conversation id.UX Journey
Before
After
Architecture Diagram
Before
After
Connection inventory:
conversation.idinstead ofconversationIdLabel Snapshot
risk: lowsize: XScorecore:orchestratorTesting
db-hex-id) differs from platform conversation id (40865006); assertsupdateConversationis called with the DB id and the reply is addressed to the platform id.bun test orchestrator-agent.test.ts -t setproject→ 9 pass, 0 fail.bun run type-checkclean; lint 0 errors./setprojectnow returnsProject set to ....Notes
No linked issue (bug found during local setup). Happy to file one if preferred.
Summary by CodeRabbit
Bug Fixes
/setprojectcommand to use the database conversation identifier when updating conversation records, replacing incorrect platform identifier usage. Corrected message routing to ensure proper delivery.Tests
/setprojectcommand to validate database and platform conversation identifier handling.