feat(context): name the message a reply is addressing #616

Closed
coilyco-ops wants to merge 1 commit from coilyco-ops/name-what-a-reply-addresses into main AGit
Member

closes #579 - a reply reached the model only if the message it addressed happened to fall inside the history window. Older than that and the turn's subject became whatever was said most recently.

closes #579 - a reply reached the model only if the message it addressed happened to fall inside the history window. Older than that and the turn's subject became whatever was said most recently.
feat(context): name the message a reply is addressing
All checks were successful
ci / image-build (pull_request) Successful in 24s
ci / test (pull_request) Successful in 43s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
e21e825cfc
Current() was built from the incoming payload alone and carried nothing about
the reply, so the addressed message reached the model only if it happened to
fall inside the history window, positioned as one ordinary line among others. A
reply to anything older than the window did not reach the model at all, and the
turn's subject became whatever was said most recently.

The harness already read ReferencedMessage twice, for summon detection and for
trace lookup, whose comment states this issue's argument in another context: the
id a member wants is usually in the notice they replied to rather than in what
they typed. It applied that to trace ids and to summons, and not to the subject.

Three shape decisions, recorded on the issue before building.

Named rather than adjacent. Injecting the addressed message as the last history
entry is cheaper and is also indistinguishable from coincidence, because the
model cannot tell an entry placed there deliberately from one that merely
happened to be recent. That is the same defect wearing a different hat.

Supplements recency rather than replacing it. A member who replies to an old
message and then asks something unrelated is real, and promoting the reference
to sole subject would answer the wrong question for them confidently.

Resolved before the turn runs, because Current takes no context. The Gateway
delivers the reference inline for most replies and that costs nothing. When it
does not, which is likeliest for exactly the old messages this is worth most
for, the fetch draws on the same lookup budget as the other gate-forced REST
calls. A reference that cannot be read is an ordinary message, not a failure.

ReplyTo is a ReplyReference rather than a nested TranscriptEntry, because that
type generates the MCP turn tool's input schema and a self-referential type is a
cycle the generator refuses. The existing MCP tests caught that, not review.

The rendered prompt snapshots do not move. This is turn content.

closes #579

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Author
Member

Closing. My mistake, and it is worth naming rather than quietly deleting. Angie (ENG).

I branched the reply-context work off my own shutdown branch instead of off main, so this pull request carries two unrelated commits and two closing references:

9c25cdf  feat(shutdown): wait for the turns a restart would otherwise cut   -> already PR 612
e21e825  feat(context): name the message a reply is addressing             -> the intended one

Merging it would have landed #612 twice and made the closing reference ambiguous.

The reply-context change is now #617, cherry-picked onto main as a single commit. Gate green there.

One useful thing fell out of the fix: the cherry-pick applied with no conflict, which is direct evidence that 612 and 617 touch disjoint regions of agent.go and can land in either order.

**Closing. My mistake, and it is worth naming rather than quietly deleting. Angie (ENG).** I branched the reply-context work off my own shutdown branch instead of off `main`, so this pull request carries two unrelated commits and two closing references: ``` 9c25cdf feat(shutdown): wait for the turns a restart would otherwise cut -> already PR 612 e21e825 feat(context): name the message a reply is addressing -> the intended one ``` Merging it would have landed https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/pulls/612 twice and made the closing reference ambiguous. **The reply-context change is now https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/pulls/617**, cherry-picked onto `main` as a single commit. Gate green there. One useful thing fell out of the fix: the cherry-pick applied with no conflict, which is direct evidence that 612 and 617 touch disjoint regions of `agent.go` and can land in either order.
coilyco-ops closed this pull request 2026-08-13 17:18:21 +00:00
All checks were successful
ci / image-build (pull_request) Successful in 24s
ci / test (pull_request) Successful in 43s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/sirens-echo!616
No description provided.