Skip to content

feat(memory): implement context budgeting and continuation (#202) - #236

Merged
kkaradag2 merged 1 commit into
mainfrom
issue/202
Sep 27, 2026
Merged

kkaradag2 merged 1 commit into
mainfrom
issue/202

Conversation

@kkaradag2

Copy link
Copy Markdown
Collaborator

Summary

Implement one shared context budget for instructions, tool schemas, current-turn content, Memory history, RAG evidence and response reserve. Agents reassembles context before every model call; mandatory content takes priority, followed by accepted evidence and then newest complete history groups within configurable message/token limits. Accounting is explicitly estimated, and mandatory overflow stops execution before another model call.

Preserve tool-call/result relationships and stable citation mappings across continuations. OpenAI Responses carries ordered reasoning output, including encrypted reasoning, through budgeted invocation-local snapshots without restoring excluded history through a previous-response chain. Empty completions and pre-delta provider failures retain the latest call's budget diagnostics.

Keep continuation state out of durable Memory snapshots, serialized messages and append identity. The original version-one fixture remains unchanged, and PostgreSQL retains exact payload comparison and compatible idempotent receipts. Existing persistence, ownership and authorization boundaries remain intact.

Validation

  • Implementation validation: Memory tests — 69 passed; Agents tests — 804 passed, 5 skipped.
  • Targeted provider/runtime/context-budget validation after review fixes — 89 passed.
  • Final persistence compatibility regression validation — 16 Memory serialization, 8 real PostgreSQL idempotency and 5 OpenAI reasoning continuation tests passed; no failures or skips.
  • Relevant builds and diff checks passed; existing NU1902 warnings remain.
  • Review findings were resolved; final review/re-review outcome: PASS, confirmed before finalization. No additional tests were run during finalization.

Closes #202
Closes #233
Closes #234
Closes #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant