Skip to content

Requested: Support dynamic filesystem resolution via requestContext in Workspace #13133

@daneatmastra

Description

@daneatmastra

This issue was created from Discord post 1473270947413885040:

Open in Discord

Workspace options like skills, instructions, model, tools, and memory all support dynamic functions that receive requestContext:

skills: (context) => { ... }          // :white_check_mark: dynamic

But filesystem only accepts a static instance:

// no way to resolve dynamically per request
filesystem: new LocalFilesystem({
    basePath: './workspace',
    readOnly: false,
})

Use case: We run a multi-role agent on a shared workspace. Each role should be scoped to a different filesystem root or have different read/write permissions. Today we're forced to create separate Workspace instances per role at the run time.

Requested: Allow filesystem to accept a function that receives requestContext, matching the pattern of every other dynamic option:

const workspace = new Workspace({
    filesystem: ({ requestContext }) => {
      const role = requestContext.get('agent-role');
      return new LocalFilesystem({
        basePath: `/workspaces/${role}`,
      });
    },
    // ...
});

This would let a single Workspace instance dynamically scope filesystem access per request different base paths, different permissions, or even different filesystem implementations (local vs S3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions