Repository navigation
Plugin API: pass the target workspaceId to the agent.create before-hook #8017
tabulius-ux
started this conversation in
Ideas
Replies: 1 comment
|
We merged #10786, and It will be in the next beta, before stable. The Updates page shows how to join the beta. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Context. A plugin that grants per-workspace resources through
agent.create(we inject an MCPserver bound to the workspace's device) can only derive the workspace from
config.cwd. In 0.13.0the hook request is
{ config, env }(@getpaseo/plugin/dist/server/lifecycle.d.ts:85–89).Problem. The registered workspace and the cwd can differ:
create_agentwithworkspace: { kind: "existing", workspaceId: B, cwd: <dir in A> }(
agent/tools/paseo-tools.js:1383–1401),lockedCwd, or a voice session (allowCustomCwd: false)together with an explicit
workspaceId(agent/create-agent/create.js:136–149).The plugin then resolves the resource of workspace A for an agent registered in B. The
DaemonClient.createAgentpath is fine: it replaces the cwd with B's directory.agent.session_opendoes receiveworkspaceId, but by then the config is fixed and the hook canonly change
env.Request. Include the resolved target
workspaceId(ornull) in theagent.createrequest,read-only like
config.cwd. With that, a plugin can refuse to inject resources when theregistered workspace and the cwd disagree.
Related: #7729 (also about what plugin hooks can see).
Tested against 0.13.0; happy to test a build.
All reactions