Repository navigation
Ticket #28: Approval resumption's saved-tool-call check reads through ThreadBackend - #29
Merged
Merged
Conversation
…nd (ticket #28) The last of the three direct-getThreadMessages sites ticket #23 found but left out of scope: approvals/wiring.ts's saved-tool-call verification read a thread's messages straight from the inert routineIntelligence placeholder in postgres mode. Same fix as #21/#23: savedToolCall's ThreadHistory type widens from Pick<IntelligenceLike, "getThreadMessages"> to a plain union with Pick<ThreadBackend, "getThreadMessages"> -- no adapter needed, same reasoning as ThreadTranscript in channels/summary.ts. headlessThreadAccess itself moves earlier in index.ts, to right after routineIntelligence's own declaration: approvalService is built long before routineAgentRunner exists, and headlessThreadAccess (unlike its sibling headlessRunner) never actually needed routineAgentRunner in the first place. headlessRunner stays where it was. New test in approvals-saved-call.test.ts seeds a real postgres thread with a saved tool call and confirms savedToolCall matches it correctly when read through the real ThreadBackend, not a fake. See docs/brooklyn/DECISIONS.md CopilotKit#31. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getThreadMessagessites ticket Channel-naming and delivery-channel history read through ThreadBackend #23 found but left out of scope:approvals/wiring.ts's saved-tool-call verification read a thread's messages straight from the inertroutineIntelligenceplaceholder in postgres mode. Same fix as createTurnRunner works with ThreadBackend: routines fire, approval-continuation resumes #21/Channel-naming and delivery-channel history read through ThreadBackend #23:savedToolCall'sThreadHistorytype widens to a plain union withPick<ThreadBackend, "getThreadMessages">— no adapter needed, same reasoning asThreadTranscriptinchannels/summary.ts.headlessThreadAccessitself moves earlier inindex.ts, to right afterroutineIntelligence's own declaration:approvalServiceis built long beforeroutineAgentRunnerexists, andheadlessThreadAccess(unlike its siblingheadlessRunner) never actually neededroutineAgentRunnerin the first place.headlessRunnerstays where it was.See
docs/brooklyn/DECISIONS.mdCopilotKit#31 for the full reasoning.Closes #28.
Test plan
bun run typecheck/bun run lint— greenapprovals-saved-call.test.tsseeds a real postgres thread with a saved tool call and confirmssavedToolCallmatches it correctly through the realThreadBackendapprovals-saved-call.test.ts,approvals-execute.test.ts,approvals-interactive.integration.test.ts,approvals-policy.integration.test.ts,approvals-store.integration.test.ts,approvals.test.ts— all pass unchangedbun test): 8210 pass / 17 fail / 9 errors — back to the normal baseline, same pre-existing categories, no regressions🤖 Generated with Claude Code