Skip to content

bug: scheduler.go silently ignores os.WriteFile error when writing agent run log #65

@jpleva91

Description

@jpleva91

Bug: Ignored Error from os.WriteFile in Scheduler

File: internal/scheduler/scheduler.go line 242

Description

In executeAgent(), the log file write result is silently discarded:

os.WriteFile(logPath, []byte(logContent), 0o644)

If the outputs/logs/ directory doesn't exist, the disk is full, or permissions are wrong, the failure is invisible. There's no indication that run telemetry is being lost.

Fix

Check and log the error:

if err := os.WriteFile(logPath, []byte(logContent), 0o644); err != nil {
    fmt.Printf("[scheduler] ⚠ %s: failed to write log: %s\n", agent.Name, err)
}

Impact

Silent data loss for agent run logs. In a governance-focused tool this is especially problematic — audit logs must be reliable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium prioritybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions