Merge remote-tracking branch 'github/master' into feat/agent-event-payload
This commit is contained in:
@@ -232,12 +232,13 @@ export function apply(ctx: Context, config: Config): void {
|
||||
if (location === undefined) return decision
|
||||
const state = renderState(location)
|
||||
if (previous !== undefined && previous.state === state) return decision
|
||||
const text = renderReading(location, turn)
|
||||
return {
|
||||
kind: 'enter',
|
||||
messages: [
|
||||
createUserMessage({
|
||||
content: [{ type: 'text', text: renderReading(location, turn) }],
|
||||
source: { kind: 'plugin', plugin: name },
|
||||
content: [{ type: 'text', text }],
|
||||
source: { kind: 'plugin', plugin: name, form: 'snapshot', sections: [{ name, text }] },
|
||||
}),
|
||||
...decision.messages,
|
||||
],
|
||||
|
||||
@@ -169,7 +169,14 @@ describe('tmux-context injection', () => {
|
||||
])
|
||||
const event = session.events.at(-1)
|
||||
if (event?.type !== 'user/message') throw new Error('missing tmux context')
|
||||
expect(event.data.source).toEqual({ kind: 'plugin', plugin: 'tmux-context' })
|
||||
// `snapshot` form: one named contribution carrying exactly the reading the
|
||||
// model saw, so a consumer attributes it without re-splitting prose.
|
||||
expect(event.data.source).toMatchObject({
|
||||
kind: 'plugin',
|
||||
plugin: 'tmux-context',
|
||||
form: 'snapshot',
|
||||
sections: [{ name: 'tmux-context' }],
|
||||
})
|
||||
expect(event.surfaceOp).toBe('append')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user