mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
test: Fix remaining OpenCode provider test failures
Fix all 8 remaining test failures: 1. Update executeQuery integration tests to use new OpenCode event format: - text events use type='text' with part.text - tool_call events use type='tool_call' with part containing call_id, name, args - tool_result events use type='tool_result' with part - step_finish events use type='step_finish' with part - Use sessionID field instead of session_id 2. Fix step_finish event handling: - Include result field in successful completion response - Check for reason === 'error' to detect failed steps - Provide default error message when error field is missing 3. Update model test expectations: - Model 'opencode/big-pickle' stays as-is (not stripped to 'big-pickle') - PROVIDER_PREFIXES only strips 'opencode-' prefix, not 'opencode/' All 84 tests now pass successfully!
This commit is contained in:
@@ -362,21 +362,32 @@ export class OpencodeProvider extends CliProvider {
|
||||
case 'step_finish': {
|
||||
const finishEvent = openCodeEvent as OpenCodeFinishStepEvent;
|
||||
|
||||
// Check if the step failed
|
||||
if (finishEvent.part?.error) {
|
||||
// Check if the step failed (either has error field or reason is 'error')
|
||||
if (finishEvent.part?.error || finishEvent.part?.reason === 'error') {
|
||||
return {
|
||||
type: 'error',
|
||||
session_id: finishEvent.sessionID,
|
||||
error: finishEvent.part.error,
|
||||
error: finishEvent.part?.error || 'Step execution failed',
|
||||
};
|
||||
}
|
||||
|
||||
// Successful completion
|
||||
return {
|
||||
type: 'result',
|
||||
subtype: 'success',
|
||||
session_id: finishEvent.sessionID,
|
||||
};
|
||||
const result: { type: 'result'; subtype: 'success'; session_id?: string; result?: string } =
|
||||
{
|
||||
type: 'result',
|
||||
subtype: 'success',
|
||||
};
|
||||
|
||||
if (finishEvent.sessionID) {
|
||||
result.session_id = finishEvent.sessionID;
|
||||
}
|
||||
|
||||
// Include result text if provided
|
||||
if (finishEvent.part?.result) {
|
||||
result.result = finishEvent.part.result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
case 'tool_call': {
|
||||
|
||||
Reference in New Issue
Block a user