Repository navigation
Expose caller identity to app code - #2346
Open
JustYannicc wants to merge 4 commits into
Open
JustYannicc wants to merge 4 commits into
JustYannicc wants to merge 4 commits into
Conversation
JustYannicc
force-pushed
the
feat/app-caller-identity
branch
from
October 25, 2026 06:31
02b4c69 to
6575eae
Compare
JustYannicc
force-pushed
the
feat/app-caller-identity
branch
from
October 25, 2026 08:22
6575eae to
019867a
Compare
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The app-authoring docs already expose each caller's linked accounts as
ctx.user.accounts. This addsctx.user.idto that existing context so apps can attribute records and usage to the caller independently of linked accounts, including apps with no account requirements.user: { accounts }andapp: { accounts }keep their documented meanings. The host supplies the new opaque ID after authentication; public tool input cannot choose it. The factory form still receives noctx.userfor app-scoped background work, so factories read the ID withctx.user?.id. The same PR expands the authoring docs with this distinction and guidance for shared app storage and caches.App-scoped schedules and workflows keep no
ctx.user. Hosts without user identities may leavectx.user.idundefined. User-scoped tool and skill caches now include the caller, since app factories can produce different declarations for users with identical accounts.This advances the app host protocol to 14 and the framework package to
0.0.1-beta.109. Adapters retain protocols 1 through 13. Review caller propagation through the runtime and workflow preparation, then the cache keys and portable host binding.Verification
bun run formatandbun run checkpassed on the rebased candidate019867a0. The protocol checker confirms protocols 1 through 13 are unchanged and protocol 14 keeps their bundles running.A minimal authored handler is:
The shared-app scenario asserts that its result equals each caller's authenticated session ID. It also asserts that a supplied tool-input ID cannot replace that result. Reproduce it with either target:
Production/deployed Cloud and user schedules or webhooks were not separately exercised. No full suite was run locally.