Skip to content

Diagnostic logging #13204

Closed as not planned
Closed as not planned

Description

@florianleibert

Task: Diagnostic logging

Description

Implement the diagnostic log file system for quality monitoring. Supports three verbosity levels (minimal, normal, verbose), configurable log path, and automatic rotation to prevent unbounded disk usage.

Acceptance Criteria

  • packages/opencode/src/quality/logger.ts created
  • Log file created at configurable path (default: .opencode/quality.log)
  • Three log levels:
    • minimal: score and model ID only (one line per response)
    • normal: score breakdown, diagnostic notes, regression alerts
    • verbose: full prompt summary, response summary, all metadata
  • Log entries are structured with: timestamp, session_id, model_id, level-appropriate content
  • Log rotation: when file exceeds configurable max size (default: 50MB), rotate to .log.1, .log.2, .log.3, delete oldest
  • Logging toggleable via quality.logging config (default: true)
  • Log level controlled via quality.logLevel config
  • Logger called from scoring pipeline after each score computation
  • Logger is non-blocking — writes are buffered/async
  • Logger handles file I/O errors gracefully (warn once, don't spam)

Technical Details

  • Use Bun.file() and Bun.write() for efficient file I/O
  • Append mode for normal writes, rotate when size threshold crossed
  • Rotation check: stat the file size before each write batch, rotate if over limit
  • For verbose level: truncate prompt/response to first 500 chars to keep logs manageable
  • Expose QualityLogger.log(entry) as main API, called from scorer.ts after scoring

Dependencies

  • Task 002: Quality configuration (for log settings)
  • Task 003: Scoring engine (provides data to log)

Effort Estimate

  • Size: S
  • Hours: 3-4
  • Parallel: true (can run alongside 004, 005)

Activity

  1. R44VC0RP commented on Feb 11, 2026

    @R44VC0RP
    Contributor

    denounce

  2. added a commit that references this issue on Feb 11, 2026
  3. added a commit that references this issue on Feb 15, 2026
  4. added a commit that references this issue on Feb 17, 2026
  5. added a commit that references this issue on May 5, 2026
  6. added a commit that references this issue on May 18, 2026
  7. added a commit that references this issue on Jun 14, 2026
  8. added a commit that references this issue on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions