-
Notifications
You must be signed in to change notification settings - Fork 0
feat(routes): pass request identity, lineage, and read-only state/notices to context providers (#459) #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7106013
feat(routes): pass request identity, lineage, and read-only state/not…
ScriptedAlchemy 6944eab
chore(changeset): reference #556
ScriptedAlchemy abe3f11
docs(framework-mode): providers resolve after the request opens (#459…
ScriptedAlchemy 9dfb7ee
test(cli-routes-build): expect notices view keys inbox+published (ali…
ScriptedAlchemy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@agent-bundle/runtime": patch | ||
| "agent-bundle": patch | ||
| --- | ||
|
|
||
| Hand `src/providers/<name>` factories the request they run for: `AgentProviderContext` gains `host`, `session`, `workspace`, and `lineage` (live `tree` included) exactly as the route observes them on `await agent()`, plus read-only `state` (`lifetime`, `read()`) and `notices` (`inbox()`) views of the mounted handles; `dispatch`, `publish`, and `acknowledge` stay route-only, and `agent()`/`useAgent()` inside a factory throw `outside-invocation`. Every generated request scope (Flight worker, rendered CLI/script worker, plain routed CLI) and the `agent-bundle/test` harness now run providers as the request's own resolver — after `runAgentRequest` freezes the identity axes and opens the notice lease, before the route — and `runAgentRequest` accepts `providers` as an `AgentProviderResolver` `(request: AgentProviderRequest) => values` beside the plain record. New exports: `AgentProviderObserved`, `AgentProviderLineage`, `AgentProviderLineageTree`, `AgentProviderLineagePeer`, `AgentProviderLineageSubagent`, `AgentProviderLineageResolution`, `AgentProviderStateHandle`, `AgentProviderStateSnapshot`, `AgentProviderNotice`, `AgentProviderNoticesHandle` from `agent-bundle`; `AgentProviderRequest`, `AgentProviderResolver`, `AgentProviderStateHandle`, `AgentProviderNoticesHandle` from `@agent-bundle/runtime`. Factories that destructure `{ invocation, signal }` are unchanged. (#556) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new ordering contradicts
docs/framework-mode.md:150-152, which still tells users that providers run “before the request scope opens.” That guidance is now operationally wrong: custom hosts following it cannot supply the newly promised frozen identity axes or mounted state/notice handles. Update that reference to describe resolution after the notice lease opens and before the route runs.AGENTS.md reference: AGENTS.md:L78-L81
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in abe3f11:
docs/framework-mode.mdnow states that providers resolve afterrunAgentRequestfreezes the identity axes and opens the notice lease, before the route, and lists the fields the factory context carries; it points atentry-conventions.mdfor the full contract. A search for any other "before the request scope" wording acrossdocs/,website/docs/{en,zh}, and the example READMEs found no remaining instance.