Skip to content

fix: wait for agent_case LanceDB visibility before skill extraction#286

Open
rendigua2025-gif wants to merge 1 commit into
EverMind-AI:mainfrom
rendigua2025-gif:codex/wait-agent-case-visibility
Open

fix: wait for agent_case LanceDB visibility before skill extraction#286
rendigua2025-gif wants to merge 1 commit into
EverMind-AI:mainfrom
rendigua2025-gif:codex/wait-agent-case-visibility

Conversation

@rendigua2025-gif

Copy link
Copy Markdown

Summary

Addresses #275.

SkillClusterUpdated can arrive before the corresponding agent_case is visible through LanceDB. Previously, extract_agent_skill checked LanceDB once, raised _CaseNotYetIndexedError, and could quickly consume OME retry budget during normal cascade/indexer lag.

This PR adds a short bounded visibility wait inside _load_target_case before raising the existing retry-class error.

Scope

  • Poll agent_case_repo.find_by_owner_entry(...) for a small bounded window.
  • Return immediately once the target case becomes visible.
  • Preserve the existing _CaseNotYetIndexedError path when the case is still not visible after the window.

This is a low-risk mitigation, not a full architectural fix. If LanceDB visibility lag exceeds the short wait window, OME retry still handles the delayed dependency. A deeper fix could emit SkillClusterUpdated only after confirmed case index visibility, carry enough case data in the event payload, or model dependency-not-ready as delayed scheduling.

Tests

  • tests/unit/test_memory/test_strategies/test_extract_agent_skill.py
  • tests/integration/test_ome_strategies_integration.py -k test_skill_chain_e2e

Note: I verified locally on Windows with a test-process-only fcntl stub because the current repository still imports POSIX fcntl during test collection on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant