mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-06 02:34:09 +08:00
- Add --agent parameter for agent-based backend/model resolution - Add --prompt-file parameter for agent prompt injection - Add opencode backend support with JSON output parsing - Add yolo field in agent config for auto-enabling dangerous flags - claude: --dangerously-skip-permissions - codex: --dangerously-bypass-approvals-and-sandbox - Add develop agent for code development tasks - Add omo skill for multi-agent orchestration with Sisyphus coordinator - Bump version to 5.5.0 Generated with SWE-Agent.ai Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
33 lines
836 B
Go
33 lines
836 B
Go
package main
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestBackendParseJSONStream_UnknownEventsAreSilent(t *testing.T) {
|
|
input := strings.Join([]string{
|
|
`{"type":"turn.started"}`,
|
|
`{"type":"assistant","text":"hi"}`,
|
|
`{"type":"user","text":"yo"}`,
|
|
`{"type":"item.completed","item":{"type":"agent_message","text":"ok"}}`,
|
|
}, "\n")
|
|
|
|
var infos []string
|
|
infoFn := func(msg string) { infos = append(infos, msg) }
|
|
|
|
message, threadID := parseJSONStreamInternal(strings.NewReader(input), nil, infoFn, nil, nil)
|
|
if message != "ok" {
|
|
t.Fatalf("message=%q, want %q (infos=%v)", message, "ok", infos)
|
|
}
|
|
if threadID != "" {
|
|
t.Fatalf("threadID=%q, want empty (infos=%v)", threadID, infos)
|
|
}
|
|
|
|
for _, msg := range infos {
|
|
if strings.Contains(msg, "Agent event:") {
|
|
t.Fatalf("unexpected log for unknown event: %q", msg)
|
|
}
|
|
}
|
|
}
|