Skip to content

Commit 8191620

Browse files
committed
pre-launch fixes: LICENSE (21no.de), subagent contract guard, README test count
1 parent 03b6422 commit 8191620

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 BackendStack21
3+
Copyright (c) 2026 21no.de / BackendStack21
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ The full `Config` struct supports: `BaseURL`, `Thinking`, `SandboxCleanup`, `Ren
173173
## Test
174174

175175
```bash
176-
go test ./... # 695+ tests, all pass
176+
go test ./... # 888 tests, all pass
177177
go test -race ./... # race detector clean
178-
go test -cover ./... # 80%+ average coverage
178+
go test -cover ./... # 79%+ average coverage
179179
```
180180

181181
Everything runs with `go test` — no Docker, no network, no external services required for unit tests.

cmd/kode/subagent_contract_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func init() {
5353
// ── 1. Flag Parsing ─────────────────────────────────────────────────
5454

5555
func TestSubagent_GoalFlag(t *testing.T) {
56+
skipIfNoBinary(t)
5657
cmd := exec.Command(kodeBinary, "subagent", "--goal", "test goal")
5758
cmd.Stderr = &bytes.Buffer{}
5859
out, err := cmd.Output()
@@ -72,6 +73,7 @@ func TestSubagent_GoalFlag(t *testing.T) {
7273
}
7374

7475
func TestSubagent_ContextFlag(t *testing.T) {
76+
skipIfNoBinary(t)
7577
cmd := exec.Command(kodeBinary, "subagent",
7678
"--goal", "test",
7779
"--context", "important background",
@@ -88,6 +90,7 @@ func TestSubagent_ContextFlag(t *testing.T) {
8890
}
8991

9092
func TestSubagent_TaskFileFlag(t *testing.T) {
93+
skipIfNoBinary(t)
9194
taskFile := filepath.Join(t.TempDir(), "task.json")
9295
taskData := map[string]string{
9396
"goal": "build auth middleware",
@@ -109,6 +112,7 @@ func TestSubagent_TaskFileFlag(t *testing.T) {
109112
}
110113

111114
func TestSubagent_TimeoutFlag(t *testing.T) {
115+
skipIfNoBinary(t)
112116
cmd := exec.Command(kodeBinary, "subagent",
113117
"--goal", "test",
114118
"--timeout", "30",
@@ -125,6 +129,7 @@ func TestSubagent_TimeoutFlag(t *testing.T) {
125129
}
126130

127131
func TestSubagent_MaxIterFlag(t *testing.T) {
132+
skipIfNoBinary(t)
128133
cmd := exec.Command(kodeBinary, "subagent",
129134
"--goal", "test",
130135
"--max-iter", "5",
@@ -156,6 +161,7 @@ func TestSubagent_QuietFlag(t *testing.T) {
156161
}
157162

158163
func TestSubagent_ParentSessionFlag(t *testing.T) {
164+
skipIfNoBinary(t)
159165
cmd := exec.Command(kodeBinary, "subagent",
160166
"--goal", "test",
161167
"--parent-session", "20260519-test123",
@@ -172,6 +178,7 @@ func TestSubagent_ParentSessionFlag(t *testing.T) {
172178
}
173179

174180
func TestSubagent_RejectsGoalAndTaskTogether(t *testing.T) {
181+
skipIfNoBinary(t)
175182
taskFile := filepath.Join(t.TempDir(), "task.json")
176183
os.WriteFile(taskFile, []byte(`{"goal":"test"}`), 0644)
177184

@@ -187,6 +194,7 @@ func TestSubagent_RejectsGoalAndTaskTogether(t *testing.T) {
187194
}
188195

189196
func TestSubagent_RejectsNoGoalOrTask(t *testing.T) {
197+
skipIfNoBinary(t)
190198
cmd := exec.Command(kodeBinary, "subagent")
191199
out, err := cmd.CombinedOutput()
192200

@@ -201,6 +209,7 @@ func TestSubagent_RejectsNoGoalOrTask(t *testing.T) {
201209
// ── 2. Stdout Contract ──────────────────────────────────────────────
202210

203211
func TestSubagent_StdoutIsJSON(t *testing.T) {
212+
skipIfNoBinary(t)
204213
cmd := exec.Command(kodeBinary, "subagent", "--goal", "test")
205214
out, err := cmd.Output()
206215

@@ -286,6 +295,7 @@ func TestSubagent_ExitCodeOne(t *testing.T) {}
286295
func TestSubagent_ExitCodeTwo(t *testing.T) {}
287296

288297
func TestSubagent_ExitCodeThree(t *testing.T) {
298+
skipIfNoBinary(t)
289299
cmd := exec.Command(kodeBinary, "subagent")
290300
_, err := cmd.CombinedOutput()
291301

@@ -697,6 +707,15 @@ func TestDelegateTasks_PipesStderr(t *testing.T) {
697707

698708
// ── Helpers ────────────────────────────────────────────────────────
699709

710+
// skipIfNoBinary skips tests that need a real kode binary.
711+
// These tests run as part of the E2E suite (KODE_E2E=true).
712+
func skipIfNoBinary(t *testing.T) {
713+
t.Helper()
714+
if kodeBinary == "" {
715+
t.Skip("kode binary not found — set KODE_E2E=true or build first")
716+
}
717+
}
718+
700719
func isFlagParseError(err error) bool {
701720
if err == nil {
702721
return false

0 commit comments

Comments
 (0)