Skip to content

fix(agentcore): return SDK reflection text - #5183

Merged
nicoloboschi merged 2 commits into
vectorize-io:mainfrom
rudycelekli:fix/agentcore-reflect-text-20261003
Oct 6, 2026
Merged

nicoloboschi merged 2 commits into
vectorize-io:mainfrom
rudycelekli:fix/agentcore-reflect-text-20261003

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

What this fixes

AgentCore's RecallPolicy(mode="reflect") receives the SDK's ReflectResponse, whose response field is text. The adapter reads answer instead. A successful real reflection therefore raises AttributeError, is caught by the existing graceful-degradation handler, and produces empty memory context.

Read resp.text and preserve empty-response behavior. Replace the existing fabricated MagicMock.answer test with the actual generated SDK model. Add Unicode/empty-text controls and a loopback HTTP regression through the real Hindsight Python SDK, asserting both the returned context and reflection request fields.

Validation

  • Current-main reproduction with final tests: 4 failed, 42 passed, 1 skipped.
  • Full AgentCore integration suite: 46 passed, 1 skipped on Python 3.11.15 and 3.13.5. The existing manual cloud test remains skipped.
  • Native tests exercise actual generated ReflectResponse; the HTTP test calls real Hindsight.areflect against a local server and closes the owned SDK session.
  • Focused Ruff checks, Ruff format checks and git diff --check pass.
  • Required ./scripts/hooks/lint.sh invoked offline stops before lint jobs because the sparse checkout lacks hindsight-all; full repository lint is not claimed green.
  • No AWS deployment, live Hindsight server, LLM, full API/system suite or cloud credential was used. This fixes the existing integration response contract; it adds no API field, SDK capability or reflection-prompt behavior.

AI-assisted implementation and tests; source and regression evidence independently reviewed before publication.

Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
… reflect test

- drop the hand-built client that overrode the adapter's, so the real client path is exercised
@nicoloboschi

Copy link
Copy Markdown
Collaborator

Thanks! Pushed one small follow-up: the HTTP reflect test now lets the adapter build its own SDK client from the URL (instead of swapping in a hand-built one), so the real client path is covered too.

@nicoloboschi
nicoloboschi merged commit 0715029 into vectorize-io:main Oct 6, 2026
100 checks passed
@nicoloboschi nicoloboschi mentioned this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants