Track agent prompt sent from agent hooks (#3033)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -210,7 +210,9 @@ describe('OpenCodeHookService buildPtyEnv / clearPty round-trip', () => {
|
||||
const pluginPath = join(env.OPENCODE_CONFIG_DIR!, 'plugins', 'orca-opencode-status.js')
|
||||
expect(existsSync(pluginPath)).toBe(true)
|
||||
// Sanity-check the file has plugin source, not a stray write.
|
||||
expect(readFileSync(pluginPath, 'utf8')).toContain('OrcaOpenCodeStatusPlugin')
|
||||
const pluginSource = readFileSync(pluginPath, 'utf8')
|
||||
expect(pluginSource).toContain('OrcaOpenCodeStatusPlugin')
|
||||
expect(pluginSource).toContain('messageID: part.messageID')
|
||||
})
|
||||
|
||||
it('clearPty removes the same directory buildPtyEnv created', () => {
|
||||
|
||||
@@ -305,7 +305,7 @@ function getOpenCodePluginSource(): string {
|
||||
' if (!part || part.type !== "text" || !part.text) return;',
|
||||
' const role = messageRoleById.get(part.messageID);',
|
||||
' if (!role) return;',
|
||||
' await post("MessagePart", { role, text: part.text });',
|
||||
' await post("MessagePart", { role, text: part.text, messageID: part.messageID });',
|
||||
' return;',
|
||||
' }',
|
||||
'',
|
||||
|
||||
Reference in New Issue
Block a user