Resolve Issue #41: Fix discovery hydration NameError and stabilize agentic retrieval rendering - #44
Merged
Conversation
| '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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41
Changes Made
NameErrorbug indiscovery_select_stepwherejob_result_idwas undefined, which previously caused all discovered leaf chunks to silently drop before hydration. We now dynamically extract thejob_result_idfrom the hydrated chunk payloads.AGENTS.mdto document the detailed hydration, reparenting, and orphan-leaf rendering logic in Phase 2 (Discovery Merge).agent_navigate.py's render queue logic to resolve Pyright type check errors.Testing
debug_agentic_e2e.pyrun cleanly. Previously omitted leaf paths (e.g., L3 segments like2.1.1) are now successfully hydrated, reparented, and rendered in the final evidence context.make typecheckandmake lint-fixexecute with zero errors.