Skip to content

Suppress non-fatal OpenDAL memory backend warnings #416

Closed

Description

@AlexMikhalev

Description

When running terraphim-agent graph or terraphim-agent replace, multiple warning messages are logged even though the operations complete successfully:

[2026-01-06T18:17:40Z WARN  opendal::services] service=memory name=0x60000018c910 path=embedded_config.json: read failed NotFound (permanent) at read, context: { service: memory, path: embedded_config.json, range: 0- } => memory doesn't have this path
[2026-01-06T18:17:54Z WARN  opendal::services] service=memory name=0x600003bec9d0 path=thesaurus_terraphim_engineer.json: read failed NotFound (permanent) at read
[2026-01-06T18:17:54Z ERROR terraphim_service] Failed to load thesaurus: OpenDal(NotFound (permanent) at read => memory doesn't have this path

Impact

  • Functional: None - replacements work correctly despite warnings
  • UX: Confusing for users who see ERROR/WARN logs for successful operations
  • Git hooks: Warnings pollute hook output (currently suppressed with 2>/dev/null)

Expected Behavior

  • Optional config files should not produce warnings when missing
  • The thesaurus_*.json loading should gracefully handle "not found" without ERROR level log
  • Or: provide a way to configure log level / suppress expected "not found" cases

Environment

  • terraphim-agent version: latest from cargo install
  • OS: macOS Darwin 23.6.0
  • Usage: git prepare-commit-msg hook for knowledge graph replacements

Reproduction

terraphim-agent graph --role "Terraphim Engineer"
echo "test" | terraphim-agent replace --role "Terraphim Engineer"

Suggested Fix Options

  1. Change log level from WARN/ERROR to DEBUG for optional file lookups
  2. Check file existence before attempting read
  3. Add configuration option to suppress expected "not found" warnings
  4. Use Result handling that distinguishes "missing optional file" from "actual error"

Activity

  1. AlexMikhalev commented on Jan 17, 2026

    @AlexMikhalev
    ContributorAuthor

    Phase 4 Verification Report

    Status: NOT FIXED

    Evidence

    Testing on 2026-01-17 still shows warnings:

    [WARN opendal::services] service=memory path=embedded_config.json: read failed NotFound (permanent)
    [WARN opendal::services] service=memory path=thesaurus_terraphim_engineer.json: read failed NotFound (permanent)
    [ERROR terraphim_service] Failed to load thesaurus: OpenDal(NotFound ...)
    

    Root Cause

    1. OpenDAL Internal Logging: Logs WARN level when read() fails with NotFound (expected for optional files)
    2. Terraphim Service: Uses log::error! at lib.rs:462 before attempting fallback

    Suggested Fix Options

    1. Filter OpenDAL logs: Add filter_module("opendal::services", log::LevelFilter::Error) in logging init
    2. Change log levels: Change log::error! to log::debug! at line 462 (expected fallback case)
    3. Pre-check existence: Check file exists before read() to avoid OpenDAL warnings

    Issue remains OPEN - needs Phase 2 design and implementation.

  2. AlexMikhalev commented on Jan 22, 2026

    @AlexMikhalev
    ContributorAuthor

    Documented in #469: OpenDAL memory backend logs WARN/ERROR level warnings are expected behavior when optional files are missing. The fix requires changes to OpenDAL itself or to the file existence checking approach, which is tracked separately.

  3. added a commit that references this issue on Feb 13, 2026
    8acf5bb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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