Skip to content

feat: framework request store and agent() (#95) - #113

Merged
ScriptedAlchemy merged 5 commits into
mainfrom
feat/request-store-agent
Sep 1, 2026
Merged

feat: framework request store and agent() (#95)#113
ScriptedAlchemy merged 5 commits into
mainfrom
feat/request-store-agent

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

Wave 1 Lane C context core for #95.

  • Versioned realm-singleton request store with closed leases.
  • await agent() as the React-independent accessor.
  • Canonical AgentInvocation carrying the invocation-kind discriminator (tool | event | cli | script | workbench).
  • Observed identities with provenance; unavailable is a typed reason, never a fabricated string.
  • Reserved state / notices / providers extension slots.
  • MCP and CLI entrypoints install the store behind the current operations model.

Proof

examples/rsc-agent-runtime deletes its hand-rolled withRenderContext / useEdit / useRuntimeSnapshot internals. The hook Flight worker installs runAgentRequest for every render, and AfterFileEdit reads await agent(). Nested capability lists (roots, allow) are copied and frozen so a caller cannot mutate authority during a live request.

Remaining sequenced work (not this PR)

This PR does not implement durable state, the renderer useAgent() React bridge, or the filesystem route compiler.

Test plan

  • packages/rsc-runtime tests and typecheck
  • Example tests stay green
  • Topology check green after dropping the deleted helper
  • Do not merge

Fixes #95

@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4c860b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@agent-bundle/rsc-runtime Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T00:53:22.948006Z b438421 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4384210ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rsc-runtime/src/agent-request.ts Outdated
@ScriptedAlchemy ScriptedAlchemy changed the title feat(rsc-runtime): #95 versioned request store with await agent() feat: framework request store and agent() (#95) Sep 1, 2026
@ScriptedAlchemy
ScriptedAlchemy force-pushed the feat/request-store-agent branch from d1658be to f784024 Compare September 1, 2026 01:10
Comment thread packages/rsc-runtime/src/agent-request.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Sep 1, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@113
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@113
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/rsc-runtime@113

commit: 4c860b5

ScriptedAlchemy and others added 5 commits September 1, 2026 03:58
Add a versioned realm-singleton request store
(Symbol.for('@agent-bundle/rsc-runtime/request-store'),
AGENT_REQUEST_STORE_VERSION) with closed leases and
`const context = await agent()`. Identities are Observed<T> — unavailable
host/session/actor/workspace is a typed reason, never a fabricated string.
AgentInvocation carries an invocation-kind discriminator
(tool | event | cli | script | workbench). MCP and CLI entrypoints install
the same typed context; state/notices stay reserved undefined, providers
is present. A captured handle throws after the request completes.

The rsc-agent-runtime example drops its hand-rolled withRenderContext /
useEdit / useRuntimeSnapshot helper in favor of the framework store.

Refs #95
The example now uses the framework request store, so the generated
topology tree no longer lists the deleted hand-rolled helper.
…tore

Copy and freeze Observed identity values and capability arrays so a
caller cannot mutate roots/allow on a live request handle.
Keep request validation failures within the public error contract and simplify the MCP operation narrowing while touching the reviewed paths.
request boundary copies/freezes host/actor/session/workspace/capability Observed values so callers cannot bypass \`available()\`
@ScriptedAlchemy
ScriptedAlchemy force-pushed the feat/request-store-agent branch from 8463d02 to 4c860b5 Compare September 1, 2026 03:58
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Landing per owner authorization on scoped verification: @agent-bundle/rsc-runtime 34/34 plus typecheck, the RSC example pool 187 passed, and eval:spot green. Prior local gate requirements and hosted-check waiting are superseded; main CI and the end-of-Wave comprehensive pass are the safety net.

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.

Add typed Agent request context and pluggable context providers

1 participant