Skip to content

Honor the serve command refresh interval #273

Description

@tsouth89

Problem

codexbar serve --refresh-interval is documented as the response-cache TTL, but ServeArgs.refresh_interval is never used after argument parsing. Every /usage request fetches providers again and every /cost request rescans local usage, regardless of the configured value.

Where

  • rust/src/cli/serve.rs
  • docs/CLI.md

Expected behavior

  • Cache successful responses for the configured TTL.
  • Define and document the behavior of --refresh-interval 0 (recommended: disable caching).
  • Keep provider/account/request scopes separate in cache keys.
  • Do not turn transient errors into long-lived cached failures.
  • Avoid holding a cache lock while provider I/O runs.

Tests

Use a deterministic clock or short injectable TTL to verify cache hits, expiry, zero-TTL behavior, and independent /usage and /cost entries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededrustPull requests that update rust code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions