UAT: agents project context inspect always shows zero fragments — CLI never hydrates ContextTierService from project resources #6489

Open
opened 2026-04-09 21:09:30 +00:00 by HAL9000 · 0 comments
Owner

Summary

agents project context inspect <PROJECT> always shows zero fragments across all tiers because the CLI command never calls hydrate_tiers_for_plan() (or any equivalent) before querying the ContextTierService. The tier service is a Singleton that starts empty on every CLI process invocation.

Spec Reference

docs/specification.md §CLI Commands — agents project context inspect (line ~4118):

"Inspect the current state of the ACMS context assembly for a project. Shows the UKO graph structure, active strategies, indexed resources, context budget usage, and the most recent fusion result."

The spec example output shows actual fragment data:

╭─ UKO Graph (2-hop neighborhood) ─────────────────────────────────╮
│ uko-py:module/src.auth (depth 9/FULL_SOURCE, 1,240 tokens)       │
│   ├─ contains → uko-py:class/AuthHandler (depth 3, 320 tokens)   │
│   ├─ contains → uko-py:class/TokenValidator (depth 3, 280 tok)   │
│   └─ imports  → uko-py:module/src.db (depth 0, 90 tokens)        │
╰──────────────────────────────────────────────────────────────────╯

Observed Behavior

The context_inspect command (src/cleveragents/cli/commands/project_context.py, line 918) calls:

tier_service = _get_context_tier_service()
metrics: TierMetrics = tier_service.get_scoped_metrics([project])
project_fragments: list[TieredFragment] = tier_service.get_scoped_view([project])

But the ContextTierService is always empty at CLI startup — it is never populated from the project's linked resources. The command shows:

  • Hot fragments: 0
  • Warm fragments: 0
  • Cold fragments: 0
  • Total: 0

Root Cause

PR #4219 wired hydrate_tiers_for_plan() into LLMExecuteActor.execute() so that plan execution populates the tier service. However:

  1. context inspect is a standalone CLI command that runs in a fresh process — the tier service is always empty
  2. The context inspect command does NOT call hydrate_tiers_for_plan() before querying the tier service
  3. Therefore, context inspect always shows zero fragments regardless of what resources are linked to the project

Expected Behavior

agents project context inspect <PROJECT> should:

  1. Look up the project's linked resources (via NamespacedProjectRepository and ResourceRegistryService)
  2. Call hydrate_tiers_for_plan() (or equivalent) to populate the tier service from those resources
  3. Then query the tier service to show actual fragment counts and metadata

Code Location

  • src/cleveragents/cli/commands/project_context.pycontext_inspect() (line 918) — missing hydration call
  • src/cleveragents/application/services/context_tier_hydrator.pyhydrate_tiers_for_plan() — available but not called by inspect
  • src/cleveragents/application/services/llm_actors.py — lines 326–359 — shows the correct pattern for hydration

Steps to Reproduce

  1. Create a project and link a git repository resource to it
  2. Run agents project context inspect <project>
  3. Observe: all tier counts are 0, no fragments shown
  • #6284 — UAT: ContextTierService is never hydrated during plan execution (partially fixed by PR #4219, but inspect command still affected)

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Summary `agents project context inspect <PROJECT>` always shows zero fragments across all tiers because the CLI command never calls `hydrate_tiers_for_plan()` (or any equivalent) before querying the `ContextTierService`. The tier service is a Singleton that starts empty on every CLI process invocation. ## Spec Reference `docs/specification.md` §CLI Commands — `agents project context inspect` (line ~4118): > "Inspect the current state of the ACMS context assembly for a project. Shows the UKO graph structure, active strategies, **indexed resources**, context budget usage, and the most recent fusion result." The spec example output shows actual fragment data: ``` ╭─ UKO Graph (2-hop neighborhood) ─────────────────────────────────╮ │ uko-py:module/src.auth (depth 9/FULL_SOURCE, 1,240 tokens) │ │ ├─ contains → uko-py:class/AuthHandler (depth 3, 320 tokens) │ │ ├─ contains → uko-py:class/TokenValidator (depth 3, 280 tok) │ │ └─ imports → uko-py:module/src.db (depth 0, 90 tokens) │ ╰──────────────────────────────────────────────────────────────────╯ ``` ## Observed Behavior The `context_inspect` command (`src/cleveragents/cli/commands/project_context.py`, line 918) calls: ```python tier_service = _get_context_tier_service() metrics: TierMetrics = tier_service.get_scoped_metrics([project]) project_fragments: list[TieredFragment] = tier_service.get_scoped_view([project]) ``` But the `ContextTierService` is always empty at CLI startup — it is never populated from the project's linked resources. The command shows: - Hot fragments: 0 - Warm fragments: 0 - Cold fragments: 0 - Total: 0 ## Root Cause PR #4219 wired `hydrate_tiers_for_plan()` into `LLMExecuteActor.execute()` so that plan execution populates the tier service. However: 1. `context inspect` is a standalone CLI command that runs in a fresh process — the tier service is always empty 2. The `context inspect` command does NOT call `hydrate_tiers_for_plan()` before querying the tier service 3. Therefore, `context inspect` always shows zero fragments regardless of what resources are linked to the project ## Expected Behavior `agents project context inspect <PROJECT>` should: 1. Look up the project's linked resources (via `NamespacedProjectRepository` and `ResourceRegistryService`) 2. Call `hydrate_tiers_for_plan()` (or equivalent) to populate the tier service from those resources 3. Then query the tier service to show actual fragment counts and metadata ## Code Location - `src/cleveragents/cli/commands/project_context.py` — `context_inspect()` (line 918) — missing hydration call - `src/cleveragents/application/services/context_tier_hydrator.py` — `hydrate_tiers_for_plan()` — available but not called by inspect - `src/cleveragents/application/services/llm_actors.py` — lines 326–359 — shows the correct pattern for hydration ## Steps to Reproduce 1. Create a project and link a git repository resource to it 2. Run `agents project context inspect <project>` 3. Observe: all tier counts are 0, no fragments shown ## Related Issues - #6284 — UAT: ContextTierService is never hydrated during plan execution (partially fixed by PR #4219, but inspect command still affected) --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#6489
No description provided.