Skip to content

refactor(context): ContextService::inject_semantic_recall is a dead public API — not called from any production path #4022

@bug-ops

Description

@bug-ops

Description

ContextService::inject_semantic_recall (zeph-agent-context/src/service.rs:203) is a pub async method with full tiered-retrieval logic and a 30s timeout, but it is never called from any production code path.

The only callers visible via grep are test helpers. Production context assembly goes through:

  • ContextService::prepare_contextContextAssembler::gatherfetch_semantic_recall (flat path), OR
  • Agent::inject_semantic_recall (zeph-core/src/agent/context/assembly.rs:1351) — a separate shim that directly calls fetch_semantic_recall_raw without tiered retrieval.

This is the root cause of #3996: tiered retrieval is only reachable through ContextService::inject_semantic_recall, which is never wired into the agent turn loop.

Impact

Recommendation

Either:

  1. Wire ContextService::inject_semantic_recall into the turn loop (fixes bug(agent-context): MemFlow tiered retrieval never activates in production — inject_semantic_recall not called from prepare_context #3996), or
  2. Remove it and implement tiered retrieval inside ContextService::prepare_context / ContextAssembler::gather directly.

Environment

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitybugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions