github-actions[bot] commited on
Commit
84cd838
·
1 Parent(s): add96a9

Auto-deploy from GitHub: a4477d36a5533e6f869905ea940dc7944a6313bd

Browse files
Files changed (1) hide show
  1. app/services/worker.py +6 -2
app/services/worker.py CHANGED
@@ -173,17 +173,21 @@ async def _run_opencode(system_prompt: str, text: str) -> str:
173
  lines.append(decoded)
174
  logger.info(f"opencode {label}: {decoded}")
175
 
 
 
 
 
176
  try:
177
  await asyncio.wait_for(
178
  asyncio.gather(
179
  _read_stream(proc.stdout, stdout_lines, "stdout"),
180
  _read_stream(proc.stderr, stderr_lines, "stderr"),
181
  ),
182
- timeout=300
183
  )
184
  except asyncio.TimeoutError:
185
  proc.kill()
186
- raise TimeoutError("opencode timed out after 300s")
187
 
188
  await proc.wait()
189
 
 
173
  lines.append(decoded)
174
  logger.info(f"opencode {label}: {decoded}")
175
 
176
+ # A whole-book prompt (reconcile, the director pass) runs big-pickle for
177
+ # around five minutes; 300s killed those just as they were finishing. Give
178
+ # it real headroom — the client waits longer than this on purpose.
179
+ OPENCODE_TIMEOUT = 600
180
  try:
181
  await asyncio.wait_for(
182
  asyncio.gather(
183
  _read_stream(proc.stdout, stdout_lines, "stdout"),
184
  _read_stream(proc.stderr, stderr_lines, "stderr"),
185
  ),
186
+ timeout=OPENCODE_TIMEOUT
187
  )
188
  except asyncio.TimeoutError:
189
  proc.kill()
190
+ raise TimeoutError(f"opencode timed out after {OPENCODE_TIMEOUT}s")
191
 
192
  await proc.wait()
193