fix: escalation memory spans render wrong type and empty results#963
Merged
Conversation
The escalation memory lookup emitted an "Apply escalation memory" child span typed applyDynamicFewShot, borrowed from the episodic memory flow. The trace UI renders that type as "Dynamic few-shot" and its renderer only displays episodic feedback items (response.results[].feedback), which escalation results (results[].answer) never contain - so the Results tab was always empty. - Collapse the lookup into the single "Find previous memories" span (agentMemoryLookup, "Memory lookup" in the UI) carrying request, response, fromMemory, memoryItemsMatched, and result attributes. - Retype the ingest span agentMemoryWrite -> agentMemoryStore; the former is not in the UI span-type registry and rendered as "N/A". - Emit inputs/outputs on the ingest span so its Results tab shows the persisted memory item and savedToMemory outcome. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes how escalation-memory tracing spans are typed and populated so the Studio/traceview UI renders the correct span type labels and shows meaningful Results content for ingest operations. It aligns emitted span kinds and attributes with the current UI rendering contract, without changing backend behavior.
Changes:
- Remove the
applyDynamicFewShotchild span from escalation lookup and consolidate lookup details onto the singleagentMemoryLookup(“Memory lookup”) span. - Retype escalation ingest span from
agentMemoryWritetoagentMemoryStoreand emitinputs/outputsattributes so the UI Results tab can display persisted content and outcome. - Update escalation-memory tests to assert the new span structure, kinds, and attributes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/agent/tools/test_escalation_memory.py | Updates span assertions to match the new lookup span shape and the ingest span kind/attributes (agentMemoryStore, inputs/outputs). |
| src/uipath_langchain/agent/tools/escalation_memory.py | Adjusts tracing spans for escalation memory lookup/ingest to match UI span-type registry and renderer expectations. |
RunnanJia
approved these changes
Jul 2, 2026
Contributor
|
Do you need to bump up langchain version? |
saksharthakkar
approved these changes
Jul 2, 2026
|
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.



Problem
Customer feedback (Schneider, via #dev-agent-memory): the escalation memory span in the execution trace shows type "Dynamic few-shot" and nothing in the Results tab.
Root cause, verified against
@uipath/traceview(2.45.0 and currenttraceview-uimain):applyDynamicFewShot, borrowed from the episodic memory flow. The UI labels that type "Dynamic few-shot".applyDynamicFewShotonly displays episodic feedback items — it requiresresponse.results[].feedback.comment. Escalation search results are shapedresults[].answer.{output, outcome}(nofeedbackfield ever), so the Results tab could never show anything.agentMemoryWrite, which is not in the UI span-type registry and renders as type "N/A". The registered type isagentMemoryStore.The LlmOps backend does not key any processing off these span kinds — this is purely a UI rendering contract.
Changes
applyDynamicFewShotchild span and collapse onto the single "Find previous memories" span (agentMemoryLookup→ renders as "Memory lookup"), now carryingrequest,response,fromMemory,memoryItemsMatched, andresult. On a cache hit the cached answer also remains visible as the escalation tool span's own output.agentMemoryWrite→agentMemoryStore("Memory store"), and emitinputs/outputsattributes — exactly what the UI's default renderer displays in the Results tab — so the save span shows the persisted memory item andsavedToMemoryoutcome.Notes
With today's traceview there is no span type that renders escalation-memory matches in a dedicated Results tab (
agentMemoryLookupis deliberately excluded from that tab, same as episodic lookups). Rich rendering of the matched item needs a smalltraceview-uifollow-up (e.g. a renderer forresults[].answeror a newapplyEscalationMemorytype). This PR fixes the wrong label and the misleading empty tab within the current contract.Testing
uv run pytest tests/agent/— 1273 passeduv run ruff check/ruff format --check/mypyon touched files — clean🤖 Generated with Claude Code