Skip to content

Resolve Issue #41: Fix discovery hydration NameError and stabilize agentic retrieval rendering - #44

Merged
EricNGOntos merged 4 commits into
stagingfrom
refactor/wuchengke/fix-issue-41-v2
May 12, 2026
Merged

Resolve Issue #41: Fix discovery hydration NameError and stabilize agentic retrieval rendering#44
EricNGOntos merged 4 commits into
stagingfrom
refactor/wuchengke/fix-issue-41-v2

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Closes #41

Changes Made

  • Bug Fix: Fixed a NameError bug in discovery_select_step where job_result_id was undefined, which previously caused all discovered leaf chunks to silently drop before hydration. We now dynamically extract the job_result_id from the hydrated chunk payloads.
  • Documentation: Updated AGENTS.md to document the detailed hydration, reparenting, and orphan-leaf rendering logic in Phase 2 (Discovery Merge).
  • Type Checking: Added explicit type casting in agent_navigate.py's render queue logic to resolve Pyright type check errors.
  • (Note: This branch also includes previous enhancements related to budget management and agentic stability).

Testing

  • End-to-end tests via debug_agentic_e2e.py run cleanly. Previously omitted leaf paths (e.g., L3 segments like 2.1.1) are now successfully hydrated, reparented, and rendered in the final evidence context.
  • make typecheck and make lint-fix execute with zero errors.

@EricNGOntos EricNGOntos added the bug Something isn't working label May 12, 2026
@EricNGOntos EricNGOntos self-assigned this May 12, 2026
@EricNGOntos
EricNGOntos merged commit 43f14b8 into staging May 12, 2026
9 checks passed
'show_summary': False,
}
else:
elif depth <= scope_depth:

# Category 2: Descendants of scope_path (children to explore)
if parts[:scope_depth] == scope_parts:
is_descendant = parts[:scope_depth] == scope_parts and depth > scope_depth
}
continue
else:
if depth > scope_depth:
"""


_DISCOVERY_SELECT_PROMPT = """\
errors are captured in trace and the best available result
is returned.
"""
from shared.services.retrieval.agentic import tools
data = _json.loads(text)
if isinstance(data, dict):
return _extract_from_data(data)
except (ValueError, _json.JSONDecodeError):
data = _json.loads(match.group())
if isinstance(data, dict):
return _extract_from_data(data)
except (ValueError, _json.JSONDecodeError):
- pending: list of {path, confidence, mode} for non-leaf selections
(orchestrator queues these for further drill-down)
"""
from shared.services.retrieval.app_service import _hydrate_paths_to_rows
For B-class documents (discovery-only, not KG-selected), this is the
only navigation step — no prior BFS.
"""
from shared.services.retrieval.app_service import _hydrate_paths_to_rows
try:
if model_hint:
return tiktoken.encoding_for_model(model_hint)
except Exception:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants