Title: smart-search returns "Invocation stopped" on a large store while the worker keeps re-registering · Issue #1593 · rohitg00/agentmemory · GitHub
Open Graph Title: smart-search returns "Invocation stopped" on a large store while the worker keeps re-registering · Issue #1593 · rohitg00/agentmemory
X Title: smart-search returns "Invocation stopped" on a large store while the worker keeps re-registering · Issue #1593 · rohitg00/agentmemory
Description: Measurements taken 2026-10-19 to 2026-10-20 on one macOS machine. No secrets, hostnames, user data or memory content are included here; redacted daemon.log excerpts and the /health functionMetrics block are available on request. Summary ...
Open Graph Description: Measurements taken 2026-10-19 to 2026-10-20 on one macOS machine. No secrets, hostnames, user data or memory content are included here; redacted daemon.log excerpts and the /health functionMetrics ...
X Description: Measurements taken 2026-10-19 to 2026-10-20 on one macOS machine. No secrets, hostnames, user data or memory content are included here; redacted daemon.log excerpts and the /health functionMetrics ...
Opengraph URL: https://github.com/rohitg00/agentmemory/issues/1593
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"smart-search returns \"Invocation stopped\" on a large store while the worker keeps re-registering","articleBody":"\nMeasurements taken 2026-10-19 to 2026-10-20 on one macOS machine. No secrets, hostnames, user data or memory content are included here; redacted `daemon.log` excerpts and the `/health` `functionMetrics` block are available on request.\n\n## Summary\n\nOn a large local store, `POST /agentmemory/smart-search` fails with HTTP 500 `Invocation stopped` after 6 to 12 seconds, even though the daemon log shows the same search finishing with results. The worker connection to the iii engine drops and re-registers every few minutes, which stops in-flight invocations. The same behaviour appeared on 0.9.28 (engine 0.11.2) and on 0.9.30 (engine 0.22.1).\n\n## Environment\n\n- macOS (Darwin 27), Node v24.18.0, run as a launchd service with KeepAlive.\n- agentmemory 0.9.28 with iii 0.11.2; tested again on 0.9.30 with iii 0.22.1, then rolled back.\n- Store: about 2.0 GB, about 9,000 files under the data directory. Roughly 900 sessions and 50 concurrent MCP proxy processes from separate editor sessions.\n- LLM calls go through a local OpenAI-compatible bridge to a Claude model. Consolidation, graph extraction and reflect were enabled, then turned off to cut load.\n\n## What we saw\n\n1. **`smart-search` 500.** `{\"error\":\"Invocation stopped\"}` (0.9.30: `{\"error\":{\"code\":\"invocation_stopped\",...}}`) after 6 to 12 s. The daemon log for the same query shows `Smart search compact {\"results\":5,\"lessons\":5}`. At other moments the same route returns `Function api::smart-search not found` or 404, which matches the worker being between registrations.\n2. **Worker reconnect churn.** `[iii] Reconnecting in ~1000ms (attempt 1)` followed by `Worker registered with ID: \u003cnew id>` repeated; roughly 6 re-registrations in 15 to 80 minutes on a quiet daemon, dozens per hour under load.\n3. **Invocation timeouts.** `mem::lesson-recall` and `mem::reflect` hit the 180 s bound; `state::set` and `state::list` also timed out during graph extraction. `mem::summarize` shows 10,847 failures of 31,854 calls in `/health` functionMetrics.\n4. **`/health` returns 503 when CPU is high** (alert `cpu_critical`), although the daemon is working. A supervisor that polls `/health` will kill a busy but healthy daemon. `/livez` is fine.\n5. **Index persistence warnings after hard kills.** `index persistence: BM25 shard missing` and `vector shard missing` repeat. After the supervisor force-killed the process about every 11 minutes, newly saved memories were stored (`GET /memories/:id` returns 200) but did not appear in search.\n6. **0.9.30 specifics.**\n - The CLI waits a fixed 15 s for the worker (`waitForAgentmemoryReady(15e3)`), then exits 1. On a store this size the worker needs longer, so the supervisor restarts it in a loop. Raising the constant to 240 s stopped the loop but not item 1.\n - REST auth is on by default. Older MCP proxy processes that were already running do not send the secret, and the memory tools then return empty results instead of an error, which looks like \"no memories\" rather than \"unauthorized\".\n - `MAX_OBS_PER_SESSION=200` moves captures from long sessions to dead letters (`Session observation limit reached (200)`).\n\n## What we tried\n\n- Replaced `/health` with `/livez` in the supervisor: restarts stopped, search still fails.\n- Disabled consolidation, graph extraction and reflect: load dropped, search still fails.\n- Upgraded 0.9.28 to 0.9.30 (engine 0.22.1): search still fails; worker restarted 8 times in 40 minutes; rolled back.\n\n## Questions\n\n1. Is `invocation_stopped` expected when the worker re-registers mid-call, and what makes the worker connection drop on a busy event loop (ping timeout, message size, something else)?\n2. Is there a setting to raise the worker-ready wait, the invocation timeout, or the engine ping interval?\n3. Can the MCP proxy surface a 401 or 500 to the caller instead of returning an empty result list?\n4. Can `/health` report 200 with a degraded flag instead of 503 under load, so supervisors do not kill a working daemon?\n\n## Possibly related\n\n#1378 (worker heartbeat death loop on a large store), #866 (15 s MCP proxy call timeout on large stores), #890 (`Invocation stopped` on large payloads). The behaviour here may share a cause with #1378; happy to test a fix.\n","author":{"url":"https://github.com/chanfox7","@type":"Person","name":"chanfox7"},"datePublished":"2026-10-20T06:23:09Z","url":"https://github.com/rohitg00/agentmemory/issues/1593"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e04de531-5424-85fc-681d-9d4e789200e3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D0C0:30BF61:B838C:EF283:6AEBDF83 |
| html-safe-nonce | a1ed36553ceaa06e26022d93bb1e74d5d30239a86a6e5eb9cb4b9d377739ef8e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEMwOjMwQkY2MTpCODM4QzpFRjI4Mzo2QUVCREY4MyIsInZpc2l0b3JfaWQiOiI0MTM2NjEyOTQwMjE3MDQ4OTYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d6331b8281da58b1c50e3d07758df2982f79a6f1cbbcea8b22357ee4ca753ac3 |
| hovercard-subject-tag | issue:5936990174 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rohitg00/agentmemory/1593/issue_layout |
| twitter:image | https://opengraph.githubassets.com/49e08098faa99d6ab3e02d69234e1ac907cf74515e7fd5b8dcf8eab11b9a979c/rohitg00/agentmemory/issues/1593 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/49e08098faa99d6ab3e02d69234e1ac907cf74515e7fd5b8dcf8eab11b9a979c/rohitg00/agentmemory/issues/1593 |
| og:image:alt | Measurements taken 2026-10-19 to 2026-10-20 on one macOS machine. No secrets, hostnames, user data or memory content are included here; redacted daemon.log excerpts and the /health functionMetrics ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chanfox7 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 701f7e3aecc56e7594e73fa7b7e1483af74322a67f7038be453d0feb05e86e77 |
| turbo-cache-control | no-preview |
| go-import | github.com/rohitg00/agentmemory git https://github.com/rohitg00/agentmemory.git |
| octolytics-dimension-user_id | 48523873 |
| octolytics-dimension-user_login | rohitg00 |
| octolytics-dimension-repository_id | 1166408297 |
| octolytics-dimension-repository_nwo | rohitg00/agentmemory |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1166408297 |
| octolytics-dimension-repository_network_root_nwo | rohitg00/agentmemory |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 12d1048a3491dd63e4193b2937cf72f1c24a2a52 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width