Skip to content

fix(overwatch): Fix when a coding agent hangs for a long time - #707

Merged
xavierhamel merged 1 commit into
masterfrom
xh/fix/overwatch-agent-hangs
Aug 7, 2026
Merged

fix(overwatch): Fix when a coding agent hangs for a long time#707
xavierhamel merged 1 commit into
masterfrom
xh/fix/overwatch-agent-hangs

Conversation

@xavierhamel

Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown

Greptile Summary

The PR prevents coding-agent executions from hanging indefinitely by redirecting agent streams to a sandbox log and adding a client-side deadline around sandbox commands.

  • Stages prompts and captures Claude/Codex output through scratch files.
  • Adds a deadline with a grace period beyond the server-side command timeout.
  • Adds focused tests for stream detachment, error reporting, and deadline behavior.
  • Bumps @bpinternal/overwatch from 0.3.6 to 0.3.7.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure identified.

The new deadline cleanly propagates failures into unconditional sandbox teardown, while agent executions are sequential within isolated sandboxes and redirected logs are read only after the command completes.

Important Files Changed

Filename Overview
overwatch/src/agents.ts Centralizes Claude and Codex execution through prompt staging, detached standard streams, file-backed logging, and existing timeout propagation.
overwatch/src/control-loop.ts Wraps sandbox command requests in the new client-side deadline while preserving the configured server timeout.
overwatch/src/sandbox.ts Adds a generic deadline race with a 60-second grace period and proper timer cleanup.
overwatch/src/agents.test.ts Covers prompt staging, stream redirection, API credentials, timeout forwarding, and error-output selection for both agents.
overwatch/src/sandbox.test.ts Covers timely resolution and rejection, grace-window expiration, and disabled deadlines for non-positive timeout values.

Reviews (1): Last reviewed commit: "fix(overwatch): Fix when a coding agent ..." | Re-trigger Greptile

@xavierhamel
xavierhamel merged commit 0d693a5 into master Aug 7, 2026
2 checks passed
@xavierhamel
xavierhamel deleted the xh/fix/overwatch-agent-hangs branch August 7, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants