test(chat): require interactive tool parity across advertised harnesses

This commit is contained in:
2026-10-20 18:12:59 +01:00
parent 68761652cf
commit 855de19a35
5 changed files with 115 additions and 6 deletions
+31
View File
@@ -0,0 +1,31 @@
package server
import (
"testing"
"git.a-wan.net/alan/pipelines/internal/codex"
"git.a-wan.net/alan/pipelines/internal/opencode"
)
// Advertising either real harness must not regress to a broker that can stream
// text but cannot deliver the interactive tools the web needs to finish a turn.
type interactiveWebChat interface {
chatBroker
chatPromptWithFiles
chatAnswerer
chatFormReader
chatModeler
chatShellOutputReader
}
var _ interactiveWebChat = (*opencode.Chat)(nil)
var _ interactiveWebChat = (*codex.Chat)(nil)
func TestAdvertisedChatHarnessesExposeInteractiveWebContract(t *testing.T) {
m := &chatManager{opencode: opencode.NewChat(&opencode.Connection{}), codex: &codex.Chat{}}
for _, backend := range m.Backends() {
if _, ok := m.adapter(backend).(interactiveWebChat); !ok {
t.Errorf("advertised harness %s lacks web tool controls", backend)
}
}
}