Skip to content

[codex] fix Hindsight local_external health and API memory cleanup - #24353

Closed
foras910521-lab wants to merge 2 commits into
NousResearch:mainfrom
foras910521-lab:codex/hindsight-api-lifecycle
Closed

[codex] fix Hindsight local_external health and API memory cleanup#24353
foras910521-lab wants to merge 2 commits into
NousResearch:mainfrom
foras910521-lab:codex/hindsight-api-lifecycle

Conversation

@foras910521-lab

Copy link
Copy Markdown
Contributor

What does this PR do?

Narrows the local stability work from #24337 into two low-overlap fixes:

  • Make Hindsight local_external availability verify the configured local HTTP endpoint instead of treating config presence as healthy.
  • Ensure API server run handling closes the agent memory provider in a finally path.

Root cause

local_external Hindsight mode could report available from configuration alone while the local API endpoint was down or unreachable. Separately, API server run handling could leave the agent memory provider open after request handling completed.

Changes made

  • plugins/memory/hindsight/__init__.py: probe /health and fall back to /version for local_external availability.
  • tests/plugins/memory/test_hindsight_provider.py: cover reachable, unreachable, and fallback local endpoint behavior.
  • gateway/platforms/api_server.py: close memory provider after run handling in a finally block.
  • tests/gateway/test_api_server.py and tests/gateway/test_api_server_runs.py: cover provider cleanup.

Upstream overlap check

This intentionally excludes Feishu websocket lifecycle, launchd --replace, and retryable gateway startup changes from #24337. It appears complementary to #22586: that PR checks hindsight_client importability, while this PR checks whether the configured local Hindsight HTTP endpoint is actually reachable.

Validation

  • venv/bin/python -m ruff check .
  • scripts/run_tests.sh tests/plugins/memory/test_hindsight_provider.py tests/gateway/test_api_server.py tests/gateway/test_api_server_runs.py

Result: 261 passed.

Notes

No system networking, Wi-Fi, DNS, proxy services, launchd service definitions, or third-party proxy app configuration are changed by this PR.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins comp/gateway Gateway runner, session dispatch, delivery labels May 12, 2026
@foras910521-lab foras910521-lab closed this by deleting the head repository Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants