session: stop drawing the skills block as part of a message - #1713
Open
ZeroPoint95 wants to merge 5 commits into
Open
ZeroPoint95 wants to merge 5 commits into
ZeroPoint95 wants to merge 5 commits into
Conversation
ZeroPoint95
added a commit
that referenced
this pull request
Oct 1, 2026
Assisted-by: CodeAF (ember-1) Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
ZeroPoint95
added a commit
that referenced
this pull request
Oct 1, 2026
Assisted-by: CodeAF (ember-1) Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
`Skills suited to this message:` is per-turn skill selection for the model. attachTurnSkillsLocked splices it onto the copy the provider reads in a.messages, and that same array is what shapeEntries walks to build every DisplayEntry — so Transcript and AttachReplay drew the block as though the person had typed it, at the top of every reopened conversation and after every message. Strip the block in shapeEntries, the one place a message becomes a displayed row. The remover matches only a whole trailing render the producer itself would have appended: the lead, "- " entry lines, and the closing conflict line, as a suffix. It shares the lead and the conflict line with the producer so the two cannot drift. The model-bound copy is untouched, and a person who pastes the marker or the closing sentence into their own message keeps every word. #1504 was believed to have fixed this but only proved the journal and store thread clean; the display half was never changed. Assisted-by: CodeAF (ember-1) Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF (ember-1) Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Assisted-by: CodeAF (ember-1) Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
Review of #1713 found the suffix match could not tell an injected block from one a person pasted whole into a message of their own — the pasted text was silently truncated on display, most surely on a journal-restored message, which never had an injection at all. attachTurnSkillsLocked now marks the one message it splices with the exact bytes it appended (a memory-only messagePresentation field; the journal keeps only the typed words), and shapeEntries removes exactly those bytes from exactly that message. stripTurnSkillsBlock and plan's SkillsBlockConflictLine go away; the pasted-complete-block regression cases are pinned. Assisted-by: CodeAF (ember-1) Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
ZeroPoint95
force-pushed
the
fix/skills-block-display
branch
from
October 1, 2026 04:26
9ebfee6 to
87fe990
Compare
…entity Review of #1713 asked for the two regressions it could not see from the settled record: AttachReplay's own mid-turn slice must keep the strip (nothing exercised that door), and the provenance mark's pointer-identity assumption — recordUserLocked appends user.message without re-allocating Content, unlike recordPresentedAssistant — must be a tripwire, since a deep copy on the user path would drop the mark silently and draw the model's skills block back as the person's own words. Assisted-by: CodeAF (ember-1) Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
ZeroPoint95
marked this pull request as ready for review
October 1, 2026 13:57
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.
Head:
8501fad6e9663cdfefbf73e1a60bc24104d20ead—fix/skills-block-display→devWhat prints, and why
Skills suited to this message:is per-turn skill selection — context for the model, spliced byattachTurnSkillsLockedonto the copy the provider reads.a.messages, whichshapeEntriesalso walks to build everyDisplayEntry— so Transcript, AttachReplay, and any reopen drew the block as though the person had typed it: top of new conversations, and after nearly every message whose words overlap the shelf.The fix: strip by injection provenance, never by text
attachTurnSkillsLockedmarks the one message it splices with the exact bytes it appended — a memory-onlymessagePresentation.SkillsBlockfield riding the existing presentation index intoshapeEntries.shapeEntriesremoves exactly those bytes from exactly that message. The model-bound copy is untouched.What survives
skills carried:notice is unchanged.AttachReplay's own mid-turn slice is now exercised (it draws the running turn's opening message offa.messages[:floor]), and the provenance mark's pointer-identity assumption is pinned as a tripwire —recordUserLockedappendsuser.messagewithout re-allocatingContent(unlikerecordPresentedAssistant, which deep-copies), so a deep copy on the user path would silently drop the mark and this test would go red.stripTurnSkillsBlockand plan'sSkillsBlockConflictLineare deleted;plan/contract.gois back to dev's text.Checks
internal/sessionsuite on this branch fails 5 tests:TestHeldBeltRunStopsWithoutPreparingRepository,TestHeldRecoveryRetainsTheAcceptedCrew,TestHeldRunReopensOnTheSameAdmissionWithoutPreparingFiles,TestNewAdmissionReadsSettingsChangedBeforeItsCreation,TestStandingIsolationRecordsItsCopyBeforeWorkerInitialization. Failure classification: environmental, pre-existing — all five fail identically on a cleanorigin/devcheckout on this machine (macOS/varvs/private/vartemp-path symlink inStandingIsolation, and held-run/admission timing timeouts under load in the rest). This PR touches none of them or their paths.Known, out of scope (noted, not changed)
questionconversation.go:117builds the clarify child's model-facing context withdisplayEntries(a.snapshot())— the index-less variant — so the injected block rides into that prompt. Pre-existing and model-facing (not a person-visible door), left as-is per review; noted here as an inconsistency with the display doors, which do strip.—
Drafted with CodeAF · reviewed and owned by the author