Skip to content

fix(release-gate): force the dead-letter capture failure without the session cap - #1766

Merged
rohitg00 merged 2 commits into
mainfrom
fix/gate-deadletter
Nov 12, 2026
Merged

rohitg00 merged 2 commits into
mainfrom
fix/gate-deadletter

Conversation

@rohitg00

@rohitg00 rohitg00 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Problem

The release gate fails the deadletter scenario on every platform since #1174 merged:

timed out after 20000 ms waiting for a dead letter for the failed capture

The scenario forced a capture failure by starting with MAX_OBS_PER_SESSION=2. Since #1174, the session cap evicts the lowest-value observation instead of refusing the write. The third capture now succeeds, so no dead letter appears. Every open PR fails the packed-artifact jobs for this reason.

Fix

  • mem::observe rejects a capture whose data contains the value of AGENTMEMORY_RELEASE_GATE_FAIL_OBSERVE__. The variable is unset in normal use, so behavior does not change for users.
  • The variable is on the Compose environment allowlist, so the gate can pass it to the worker.
  • The deadletter scenario sets it to the third marker, then restarts without it. The retry recovers the capture as before.

Testing

  • npm run release:gate -- --only deadletter passes locally against the packed artifact and the real engine. The dead letter records release gate: AGENTMEMORY_RELEASE_GATE_FAIL_OBSERVE__ rejected this capture.
  • New unit test in test/auto-compress.test.ts: only captures with the marker are rejected.

Summary by CodeRabbit

  • Bug Fixes
    • Failed observation captures can now be identified and handled as dead letters, including after restart, with the option to retry them.
  • Documentation
    • Updated the reported passing-test count to 4,900+ across the documentation.

…session cap

The deadletter scenario made the third capture fail by starting with
MAX_OBS_PER_SESSION=2. Since #1174 the cap evicts the lowest-value
observation instead of refusing the write, so the capture succeeded, no
dead letter appeared and the scenario timed out on every platform.

mem::observe now rejects a capture whose data contains the value of
AGENTMEMORY_RELEASE_GATE_FAIL_OBSERVE. The variable is unset in normal
use, so nothing changes for users. The gate sets it to the third marker,
restarts without it, and the retry recovers the capture as before.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
@vercel

vercel Bot commented Nov 12, 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 12, 2026 1:08pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The observation handler now rejects payloads that contain a configured release-gate marker. The Compose environment allowlist and deadletter scenario pass that marker through. Documentation and repository state files also update reported counts.

Changes: Observation Release-Gate Failure

Layer / File(s) Summary
Configure and handle observation rejection
src/cli/compose-project.ts, src/functions/observe.ts, test/auto-compress.test.ts
The worker environment allowlist passes through AGENTMEMORY_RELEASE_GATE_FAIL_OBSERVE__. The handler returns a release-gate error when the configured value appears in serialized observation data. The test checks rejection without storage and acceptance without the marker.
Configure the deadletter scenario
scripts/release-gate/run.mjs
The scenario sets AGENTMEMORY_RELEASE_GATE_FAIL_OBSERVE__ to the third marker instead of setting MAX_OBS_PER_SESSION to 2.

Test-Count and Repository Statistics

Layer / File(s) Summary
Update repository test counts
AGENTS.md, README.md, READMEs/*, scripts/docs-sync.state.json
The documentation updates the reported test count from 4,800+ to 4,900+. The state file also changes the source-file count from 260 to 262 and LOC from 61,000 to 62,000. The function count remains 323.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • rohitg00/agentmemory#1174: Changes mem::observe behavior at the session cap, which the deadletter scenario previously used to trigger a rejected capture.
  • rohitg00/agentmemory#1592: Introduces the Compose environment allowlist and release-gate lifecycle used by this change.

Suggested reviewers: guibeira

Merge Risk: Minimal · up to 282b3

The change adds an internal release-gate switch that is inactive in normal use, and updates documented test counts. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the release-gate fix, the dead-letter capture failure, and the removal of the session cap dependency. The changeset adds a marker check in mem::observe, passes the variable through the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the release-gate fix, the dead-letter capture failure, and the removal of the session cap dependency. The changeset adds a marker check in mem::observe, passes the variable through the Compose allowlist, switches the deadletter scenario from MAX_OBS_PER_SESSION=2 to the marker, and adds a unit test. The title is specific and accurate to the main change. It is slightly long at 80 characters, but it is readable and conveys the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

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: deacd1d7-8759-4bd2-8432-37ae84ad0669
Commits

Reviewing files that changed from the base of the PR and between 8408e8d and 282b3be.

Files ignored due to path filters: 2

  • assets/tags/light/stat-tests.svg is excluded by !**/*.svg
  • assets/tags/stat-tests.svg is excluded by !**/*.svg
Files selected for processing: 39

  • AGENTS.md
  • README.md
  • READMEs/README.ar-SA.md
  • READMEs/README.bn-BD.md
  • READMEs/README.cs-CZ.md
  • READMEs/README.da-DK.md
  • READMEs/README.de-DE.md
  • READMEs/README.el-GR.md
  • READMEs/README.es-ES.md
  • READMEs/README.fi-FI.md
  • READMEs/README.fr-FR.md
  • READMEs/README.he-IL.md
  • READMEs/README.hi-IN.md
  • READMEs/README.hu-HU.md
  • READMEs/README.id-ID.md
  • READMEs/README.it-IT.md
  • READMEs/README.ja-JP.md
  • READMEs/README.ko-KR.md
  • READMEs/README.nb-NO.md
  • READMEs/README.nl-NL.md
  • READMEs/README.pl-PL.md
  • READMEs/README.pt-BR.md
  • READMEs/README.pt-PT.md
  • READMEs/README.ro-RO.md
  • READMEs/README.ru-RU.md
  • READMEs/README.sv-SE.md
  • READMEs/README.th-TH.md
  • READMEs/README.tl-PH.md
  • READMEs/README.tr-TR.md
  • READMEs/README.uk-UA.md
  • READMEs/README.ur-PK.md
  • READMEs/README.vi-VN.md
  • READMEs/README.zh-CN.md
  • READMEs/README.zh-TW.md
  • scripts/docs-sync.state.json
  • scripts/release-gate/run.mjs
  • src/cli/compose-project.ts
  • src/functions/observe.ts
  • test/auto-compress.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

coderabbitai[bot]

This comment was marked as resolved.

The switch is for the release gate only, so it now ends in two
underscores like AGENTMEMORY_MCP_STDIO__. The skill reference generator
skips such internal markers, so the variable does not appear as a user
setting and skills:check passes. Documented counts are re-synced.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
@rohitg00
rohitg00 merged commit 3e48fcb into main Nov 12, 2026
18 checks passed
@rohitg00
rohitg00 deleted the fix/gate-deadletter branch November 12, 2026 14:04

This branch was successfully deployed

1 active deployment
Preview — 282b3bef Deployed Nov 12, 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