Link spin-off threads back to their originating conversation - #35
Draft
Dnyaneshvn wants to merge 1 commit into
Draft
Link spin-off threads back to their originating conversation#35Dnyaneshvn wants to merge 1 commit into
Dnyaneshvn wants to merge 1 commit into
Conversation
When the agent messages someone new mid-conversation ("go ask Alex..."),
nothing recorded why the new thread existed, so the reply came back to a
fresh session with no link home.
- record the active conversation per turn, the same seam as channel-hint.ts
- on a send to a new recipient, store a spawn link (parent session, reply
target, and the outbound message as the why)
- on the reply, inject a short context block and set modelParentSessionKey to
the parent so it inherits context and can relay the answer back
Fixes inkbox-ai#10
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.
Fixes #10.
Draft in the shape I floated on the issue, so it's easy to redirect against real code rather than in the abstract.
What was wrong
When the agent messages someone new mid-conversation ("go ask Alex about X"), the send goes out through a send tool, but nothing recorded that the new conversation was spawned from the current one. So when Alex replies,
buildTextTurnroutes it to a fresh session with no link back, no memory of why the thread exists, and no way to relay the answer home.What this does
channel-hint.tsalready uses atdispatchInboundTurnmodelParentSessionKeyto the parent session so it inherits context, the same lever the voice path already usesKeeps it to one small module plus the existing send and inbound seams, no new routing concepts.
Tests
modelParentSessionKeyis set to the parentFull suite green (352 tests).
One open choice
The parent link lives in a small module for now (mirroring
channel-hint.ts/outbound-call-context.ts). Happy to move it onto the thread/session record instead if you'd prefer it there.