fix(a2a): unambiguous session scopes and validated context ids
This commit is contained in:
@@ -78,8 +78,10 @@ restart to reach that one endpoint (`/.well-known/agent-card.json` and the exten
|
||||
## Sessions
|
||||
|
||||
One `AgentSession` per `(caller, contextId)`, opened or resumed the first time a message names that `contextId`
|
||||
(a missing one gets a fresh UUID). Scope: `<ScopePrefix>-a2a-<caller>-<contextId>` (the Telegram host's
|
||||
`ScopePrefix` is `telegram-<chatId>`). The session runs in the caller's workspace, so it loads that workspace's
|
||||
(a missing one gets a fresh UUID). A client-chosen `contextId` must match `[A-Za-z0-9_-]{1,100}`, otherwise the
|
||||
message is refused with `InvalidParams`. Scope: `<ScopePrefix>-a2a-<caller>_<contextId>` (the Telegram host's
|
||||
`ScopePrefix` is `telegram-<chatId>`); caller names never contain `_`, so two different callers or contexts can't
|
||||
share a session. The session runs in the caller's workspace, so it loads that workspace's
|
||||
`AGENTS.md` (or `CLAUDE.md`), `PERSONA.md` and `MEMORY.md` exactly like any other session there — same persona,
|
||||
same memory, separate conversation. It does **not** get a calendar (Google Calendar connections are keyed by
|
||||
session scope, and an A2A scope never connects one).
|
||||
|
||||
@@ -123,7 +123,9 @@ reads only `<caller workspace>/.volcanic/a2a/tasks/` and also requires `task.cal
|
||||
|
||||
1. **Hops**: read `metadata["volcanic.hops"]` (missing = 0). Above `MaxHops` → the task is created and immediately
|
||||
`failed` with "hop limit reached".
|
||||
2. **Context**: missing `contextId` → new UUID. Session scope `<ScopePrefix>-a2a-<caller>-<contextId>`, cwd = caller
|
||||
2. **Context**: missing `contextId` → new UUID; a given one not matching `[A-Za-z0-9_-]{1,100}` → `InvalidParams`
|
||||
(checked before anything is created). Session scope `<ScopePrefix>-a2a-<caller>_<contextId>` (caller names are
|
||||
`[a-z0-9-]`, so the first `_` separates name and context: no two pairs share a scope), cwd = caller
|
||||
workspace, `Channel` = a fresh `A2AChatChannel`, `ExtraExtensions` = `A2ASessionExtension`. `A2ASessionPool` opens
|
||||
or resumes it.
|
||||
3. **Task**:
|
||||
|
||||
Reference in New Issue
Block a user