feat(agent): support dynamic annotationId resolution across chat and comments (#375)

* feat(agent): improve timestamp precision and proxy selection for video screenshots

* feat(agent): support dynamic annotationId resolution across chat and comments

* fix(agent): scope annotation resolution to asset and format has_markup consistently
This commit is contained in:
Yiling-J
2026-09-02 15:17:56 +08:00
committed by GitHub
parent 5a754bcb94
commit 35b57cc0ab
19 changed files with 869 additions and 133 deletions
@@ -330,5 +330,25 @@ describe('serializeContextToXml', () => {
expect(serializeContextToXml(context2)).toContain('duration_seconds="14.00"')
expect(serializeContextToXml(context2)).toContain('seconds="5.5000"')
})
it('serializes annotation tag with id when context.id is provided', () => {
const context: ShumaiMessageContext = {
id: '01JABCDEF1234567890',
annotation: true,
}
expect(serializeContextToXml(context)).toBe(
'<context>\n <annotation id="01JABCDEF1234567890" />\n</context>',
)
})
it('escapes special XML characters in annotation id', () => {
const context: ShumaiMessageContext = {
id: 'test<id>&"123"',
annotation: true,
}
expect(serializeContextToXml(context)).toBe(
'<context>\n <annotation id="test&lt;id&gt;&amp;&quot;123&quot;" />\n</context>',
)
})
})
})