@@ -55,7 +55,7 @@ func init() {
5555
5656func TestSubagent_GoalFlag (t * testing.T ) {
5757 skipIfNoBinary (t )
58- cmd := exec .Command (odekBinary , "subagent" , "--goal" , "test goal" )
58+ cmd := exec .Command (odekBinary , "subagent" , "--goal" , "test goal" , "--timeout" , "3" )
5959 cmd .Stderr = & bytes.Buffer {}
6060 out , err := cmd .Output ()
6161
@@ -78,6 +78,7 @@ func TestSubagent_ContextFlag(t *testing.T) {
7878 cmd := exec .Command (odekBinary , "subagent" ,
7979 "--goal" , "test" ,
8080 "--context" , "important background" ,
81+ "--timeout" , "3" ,
8182 )
8283 cmd .Stderr = & bytes.Buffer {}
8384 _ , err := cmd .Output ()
@@ -100,7 +101,7 @@ func TestSubagent_TaskFileFlag(t *testing.T) {
100101 data , _ := json .Marshal (taskData )
101102 os .WriteFile (taskFile , data , 0644 )
102103
103- cmd := exec .Command (odekBinary , "subagent" , "--task" , taskFile )
104+ cmd := exec .Command (odekBinary , "subagent" , "--task" , taskFile , "--timeout" , "3" )
104105 cmd .Stderr = & bytes.Buffer {}
105106 _ , err := cmd .Output ()
106107
@@ -116,7 +117,7 @@ func TestSubagent_TimeoutFlag(t *testing.T) {
116117 skipIfNoBinary (t )
117118 cmd := exec .Command (odekBinary , "subagent" ,
118119 "--goal" , "test" ,
119- "--timeout" , "30 " ,
120+ "--timeout" , "3 " ,
120121 )
121122 cmd .Stderr = & bytes.Buffer {}
122123 _ , err := cmd .Output ()
@@ -134,6 +135,7 @@ func TestSubagent_MaxIterFlag(t *testing.T) {
134135 cmd := exec .Command (odekBinary , "subagent" ,
135136 "--goal" , "test" ,
136137 "--max-iter" , "5" ,
138+ "--timeout" , "3" ,
137139 )
138140 cmd .Stderr = & bytes.Buffer {}
139141 _ , err := cmd .Output ()
@@ -150,6 +152,7 @@ func TestSubagent_QuietFlag(t *testing.T) {
150152 cmd := exec .Command (odekBinary , "subagent" ,
151153 "--goal" , "test" ,
152154 "--quiet" ,
155+ "--timeout" , "3" ,
153156 )
154157 var stderr bytes.Buffer
155158 cmd .Stderr = & stderr
@@ -166,6 +169,7 @@ func TestSubagent_ParentSessionFlag(t *testing.T) {
166169 cmd := exec .Command (odekBinary , "subagent" ,
167170 "--goal" , "test" ,
168171 "--parent-session" , "20260519-test123" ,
172+ "--timeout" , "3" ,
169173 )
170174 cmd .Stderr = & bytes.Buffer {}
171175 _ , err := cmd .Output ()
@@ -183,7 +187,7 @@ func TestSubagent_RejectsGoalAndTaskTogether(t *testing.T) {
183187 taskFile := filepath .Join (t .TempDir (), "task.json" )
184188 os .WriteFile (taskFile , []byte (`{"goal":"test"}` ), 0644 )
185189
186- cmd := exec .Command (odekBinary , "subagent" , "--goal" , "x" , "--task" , taskFile )
190+ cmd := exec .Command (odekBinary , "subagent" , "--goal" , "x" , "--task" , taskFile , "--timeout" , "3" )
187191 out , err := cmd .CombinedOutput ()
188192
189193 if err == nil {
@@ -196,7 +200,7 @@ func TestSubagent_RejectsGoalAndTaskTogether(t *testing.T) {
196200
197201func TestSubagent_RejectsNoGoalOrTask (t * testing.T ) {
198202 skipIfNoBinary (t )
199- cmd := exec .Command (odekBinary , "subagent" )
203+ cmd := exec .Command (odekBinary , "subagent" , "--timeout" , "3" )
200204 out , err := cmd .CombinedOutput ()
201205
202206 if err == nil {
@@ -211,7 +215,7 @@ func TestSubagent_RejectsNoGoalOrTask(t *testing.T) {
211215
212216func TestSubagent_StdoutIsJSON (t * testing.T ) {
213217 skipIfNoBinary (t )
214- cmd := exec .Command (odekBinary , "subagent" , "--goal" , "test" )
218+ cmd := exec .Command (odekBinary , "subagent" , "--goal" , "test" , "--timeout" , "3" )
215219 out , err := cmd .Output ()
216220
217221 if err != nil {
@@ -297,7 +301,7 @@ func TestSubagent_ExitCodeTwo(t *testing.T) {}
297301
298302func TestSubagent_ExitCodeThree (t * testing.T ) {
299303 skipIfNoBinary (t )
300- cmd := exec .Command (odekBinary , "subagent" )
304+ cmd := exec .Command (odekBinary , "subagent" , "--timeout" , "3" )
301305 _ , err := cmd .CombinedOutput ()
302306
303307 if err == nil {
0 commit comments