oficina / equipo Public

Runner contract tests: log why a test link's stream ends

TestRunnerCancelAndSupersede failed twice in CI on a45234a (the runner
closed the stream straight after acking the message), passed on d0d690e
with the same runner code, and passes 800 isolated runs and full package
runs locally. The test link now logs its stream warnings to stderr, so a
CI failure names the error that ended the session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev cc6567add2658dce782fdccdefa047c82be4eddd parent a45234a
1 file changed, +2 −1
  • internal/runner/thin/contract_test.go +2 −1

CI failed — run details

diff --git a/internal/runner/thin/contract_test.go b/internal/runner/thin/contract_test.go
index 55023fc2..c65b1308 100644
--- a/internal/runner/thin/contract_test.go
+++ b/internal/runner/thin/contract_test.go
@@ -3,6 +3,7 @@ package thin
import (
"context"
"encoding/json"
+ "log/slog"
"net"
"net/http"
"os"
@@ -136,7 +137,7 @@ func startLink(t *testing.T, origin string, coord Coordinator, seed ...func(*Sta
if err := os.MkdirAll(sessions, 0700); err != nil {
t.Fatal(err)
}
- link := &Link{Origin: origin, Token: "token", State: state, Files: &Files{State: state, SessionRoot: sessions}, Hello: func() wire.Hello {
+ link := &Link{Logger: slog.New(slog.NewTextHandler(os.Stderr, nil)), Origin: origin, Token: "token", State: state, Files: &Files{State: state, SessionRoot: sessions}, Hello: func() wire.Hello {
return wire.Hello{Repos: []string{"amadan.net/oficina/sample"}, CreateIn: []string{}, Catalog: []wire.RepoInfo{}, Connections: []wire.HeldConnection{{LocalID: "claude-a", Person: "owner@example.com", Provider: "claude", Kind: "subscription", Label: "owner@example.com", State: "healthy"}}, Versions: map[string]string{"runner": "test", "claude": "2.1.312"}}
}}
engine := &Engine{State: state, Emit: link.Delta, Notify: link.Notify, Authorize: link.Confirm, Open: func(string, runner.AccountBinding) (Coordinator, error) { return coord, nil }}