Skip to content

feat: expose metadata for fold - #5649

Merged
404Wolf merged 5 commits into
new-ai-agentsfrom
wolf/cleaner-fold-final-state
Aug 14, 2026
Merged

feat: expose metadata for fold#5649
404Wolf merged 5 commits into
new-ai-agentsfrom
wolf/cleaner-fold-final-state

Conversation

@404Wolf

@404Wolf 404Wolf commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Aug 13, 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

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e465faa1-cc5f-4955-b92d-ac36dd1c353f

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

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

Comment @coderabbitai help to get the list of available commands.

@404Wolf
404Wolf changed the base branch from main to new-ai-agents August 13, 2026 23:19
The fold now maintains SessionMetadata - current model, the model menu,
title, and available commands - correlated against response bodies, so
a model change the runtime rejected moves nothing. Request ids restart
per connection, so `acp_ready` flushes pending correlation state; a
stale entry could otherwise swallow a new connection's reused id.

`FoldMachine::push` returns `Vec<FoldEvent>` in place of the single
`IncrementalFoldResult`: an empty list replaces `Unchanged`, and the
new `MetadataUpdated` variant carries the metadata whole, latest-wins.
Internally `step` reports a `StepChange` - handlers compare-and-assign
and the change travels up return values, no dirty flag or snapshot.

`LiveSessionLogWriter` observes `MetadataUpdated` and projects the
model through a new idempotent `AgentSessionRepo::set_model`, healing
on catch-up refolds; the request-side sniff in the Postgres log
repo's `create` is deleted, leaving it a plain insert plus the status
projection. The wire grows `FoldedStreamEvent` (new/update/metadata)
and a `FoldStream.metadata()` getter; the web worker plumbs the event
arrays through, with nothing rendering metadata yet.

Real fixtures move to fixtures/real/ discovered by glob, gaining a
command-invocation recording, metadata snapshots per fixture, and
correlation regression tests shaped after the rejected model change
found in a local session log.
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

@404Wolf
404Wolf marked this pull request as ready for review August 14, 2026 19:01
@404Wolf
404Wolf merged commit 93c6150 into new-ai-agents Aug 14, 2026
5 checks passed
@404Wolf
404Wolf deleted the wolf/cleaner-fold-final-state branch August 14, 2026 19:01
404Wolf added a commit that referenced this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant