Skip to content

feat(pipeline): run compression and session follow-ups through observers - #1639

Open
rohitg00 wants to merge 9 commits into
feat/iii025-s1b-observe-bindingsfrom
feat/iii025-s2a-observer-pipeline
Open

rohitg00 wants to merge 9 commits into
feat/iii025-s1b-observe-bindingsfrom
feat/iii025-s2a-observer-pipeline

Conversation

@rohitg00

@rohitg00 rohitg00 commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Stage 2a of the iii 0.25 stack. It targets #1637 (then #1636 and #1634). When iii 0.25 observers are available, background LLM work is capped and shows up in engine::observers::list. When they aren't (or with AGENTMEMORY_BINDINGS=trigger), the existing inline fire-and-forget paths run unchanged.

Live verification (engine 0.25.0, state 0.22.22, http 0.22.8, fake OpenAI-compatible server, real post_tool_use hook payloads)

check result
200 captures, AGENTMEMORY_COMPRESS_MAX_CONCURRENT=2 fake LLM peak concurrency 2; 200 calls; all 200 observations compression.status = complete; observer fires: 200
same burst with AGENTMEMORY_BINDINGS=trigger (50 captures) 50/50 complete via the inline path, peak 50, no pipeline observers
two session stops with no new titled observations between them marker unchanged, nothing re-extracted
sweep runs on its timer and dispatches stale rows (50 per run, peak ≤ 2)
gate:large-store --small --assert pass

Not proven live: sweep recovery after forced LLM failures. The fake server was set to fail its first 30 calls. The provider's circuit breaker (src/providers/resilient.ts) opened after three failures and kept throwing before any HTTP call, so only 26 calls reached the server. It never got past its failure phase, and the retried rows stayed compression_failed. The breaker treats these transient failures as hard failures. #1259 and #1350 change that behavior and are the right follow-up; the sweep itself is unit-tested.

Credits

Test plan

  • npm run build, npm run skills:gen, npm run docs:sync / docs:check, npm run skills:check
  • npm test: 4146 passed, 6 skipped
  • New test/observer-pipeline.test.ts (14 cases): pipeline mode decision, exact observer specs, gating by flags, delta marker (success-only advance, cooldown), sweep selection, limits and single-flight, post-remember input shape, inline no-op
  • Live checks in the table above

Fixes #1603. Fixes #978. Fixes #1238. Refs #1390 #1025 #1024 #1029 #1127 #568 #1268 #1280 #1309 #1259 #1350.

With iii 0.25 observers available, background work no longer goes out as
unbounded fire-and-forget calls. Compression runs from an observer on
mem::observe capped at AGENTMEMORY_COMPRESS_MAX_CONCURRENT (default 2), and a
periodic mem::compression-sweep re-dispatches observations still pending or
failed. Session-stop graph extraction, reflect and consolidation become
observers on event::session::stopped. Graph extraction only sends observations
newer than a per-session marker (KV.graphExtractMarks), with an optional
cooldown. AGENTMEMORY_GRAPH_STRUCTURAL=false turns off the heuristic graph
pass. Saved memories reach graph extraction through an observer on
mem::remember. Without observers, the existing inline paths are unchanged.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agentmemory Ready Ready Preview Nov 8, 2026 3:50pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 81cb69dd-7926-4923-9987-95b33a363ba6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

devin-ai-integration[bot]

This comment was marked as resolved.

…pipeline

CHANGELOG follows the base branch; release PRs carry the entry.
…nd late compression

- Leave the post-session graph marker unchanged when graph extraction
  reports success false.
- Tie the marker to the graph generation so a graph reset re-extracts
  sessions extracted before it.
- Use compressedAt when present, so a stop before LLM compression does
  not hide the compressed concepts and files from a later extraction.
- Pass a saved memory's files to graph extraction.
…' into feat/iii025-s2a-observer-pipeline

# Conflicts:
#	scripts/docs-sync.state.json

This branch was successfully deployed

1 active deployment
Preview — 27b0e4d7 Deployed Nov 8, 2026 by vercel[bot]
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