Skip to content

Decouple hook capture from synchronous observe - #4

Merged
wrightpt merged 1 commit into
mainfrom
agent/async-observe-ingest
Jul 14, 2026
Merged

wrightpt merged 1 commit into
mainfrom
agent/async-observe-ingest

Conversation

@wrightpt

Copy link
Copy Markdown
Owner

Summary

  • Add /agentmemory/observe/async, which returns 202 after dispatching mem::observe with iii fire-and-forget ownership.
  • Route short-lived desktop hook scripts through the async endpoint.
  • Keep /agentmemory/observe synchronous and backward-compatible for API clients such as the demo and OpenCode integration.
  • Add regression coverage and regenerate tracked REST/tool/config references.

Root cause and impact

Hook processes force-exit after 500 ms, but the synchronous observe endpoint waits for persistence, indexing, session updates, and stream fanout. When that work crosses the hook lifetime, the HTTP caller disappears while iii still tracks downstream invocation state. The async boundary acknowledges accepted hook work promptly and lets the engine own its completion.

Validation

  • npm test (133 files, 1,439 tests passed)
  • npx vitest run test/api-observe-async.test.ts test/copilot-plugin.test.ts test/consistency.test.ts test/fs-watcher.test.ts (41 passed)
  • npm run skills:check (15 skills passed)
  • npm run build
  • git diff --check

@wrightpt
wrightpt merged commit 77014dc into main Jul 14, 2026
@wrightpt
wrightpt deleted the agent/async-observe-ingest branch July 14, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant