Skip to content

feat: heartbeat logging during long-running container execution #78

@eshulman2

Description

@eshulman2

Problem

ContainerRunner.run() logs "Starting container" then goes silent until the container exits — up to 2 hours later. A stuck or slow container is completely invisible during that window. Workers appear hung with no signal of progress.

Proposed solution

In ContainerRunner.run() (src/forge/sandbox/runner.py), start a background asyncio task immediately after the subprocess is spawned. Every 60 seconds, log:

Container {container_name} still running ({elapsed}s elapsed, {remaining}s remaining of {timeout}s timeout)

Cancel the heartbeat task once process.communicate() returns. Use logger.info so it appears in normal worker output without being noisy.

Reference

Learned from fullsend: internal/cli/run.go:runHeartbeat() — emits every 30s, shows elapsed + remaining against timeout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions