fix(session): project steering messages as plain user content

steering/message previously rendered inside a <steering source="…">
envelope like context/message. No model is trained on a <steering> tag,
so the framing is arbitrary markup the model was never taught to read;
recorded transcripts show it treating the instruction as third-party
metadata and refusing it. Framing also does not belong on the session
surface — a caller that wants a frame formats its own content. It now
projects verbatim as a plain user-role message; the <context> envelope is
untouched and renderTagged becomes context-only.

Agent Note: .agents/notes/implemented/simplification/2026-07-20-unwrap-steering-message-projection.md
This commit is contained in:
Turtle
2026-07-20 11:00:36 +08:00
parent 023bed1a83
commit b25b78fd02
15 changed files with 227 additions and 421 deletions

View File

@@ -370,7 +370,7 @@ describe('deriveMessages with surface', () => {
const messages = s.deriveMessages()
expect(messages).toHaveLength(2)
expect(messages[0]!.content[0]).toMatchObject({ type: 'text', text: '<context source="plugin">' })
expect(messages[1]!.content[0]).toMatchObject({ type: 'text', text: '<steering source="user">' })
expect(messages[1]!.content).toEqual([{ type: 'text', text: 'focus' }])
})
})