Skip to content

fix(ai): a transient rag lookup failure is not cached, so the same query recovers as soon as the backend answers #1351

Closed

Description

@dan-petty

Problem

This is a Copilot thread on release PR #1283, verified at b57ef7f. investigate_rag_context caches a failed lookup as None for 60 seconds [code: src/devops_cli/ai/rag/investigator.py:447]. After a transient failure, the same query returns None for up to 60 s even once the backend has recovered, while other queries already get context. The cached entry never outlasts the circuit breaker's pause. The behaviour predates v0.2.28 (v0.2.0 #17, in its current form since v0.2.25 #1089).

Acceptance criteria

  • Only completed lookups are cached, hits and empty results alike. A failure, a pause or a stop is not cached.
  • A test fails today: a transient error, then a hit for the same query, gives [False, True], and an empty lookup is served from the cache.
  • uv run devops ci passes.

Strategic alignment

Activity

  1. added
    type/bug
    scope/ai
    priority/p3-low
    on Oct 7, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. It degrades repeated-query recovery for up to 60 s after a transient blip but does not lose data or block the run entirely.
    • Value: Medium. Users see stale None results for the same query for up to a minute after the backend is healthy, which is noticeable but self-resolving.
    • Effort: Low. The fix is a guard at the cache-write site in investigator.py:447 to skip caching on failure/pause/stop, plus one test.
  3. added a commit that references this issue on Oct 25, 2026
    de0a582
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

    priority/p3-lowscope/aitype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions