agentscope-ai / agentscope-ai/agentscope-java

Harness always materialises .agentscope/workspace under the working directory — no opt-out for SaaS / sandboxed deployments

Ouverte
#2,763 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area/harness enhancement
Langage dominant
Java
Étoiles
5.6k
Forks
1.3k
Merge moyen
4 j 12 h
PR mergées (30 j)
77

Description

# Issue draft — post on https://github.com/agentscope-ai/agentscope-java/issues

---
**Title:** Harness always materialises `.agentscope/workspace` under the working directory — no opt-out for SaaS / sandboxed deployments

**Body:**

### Problem

`HarnessAgent` always resolves a local workspace. When `workspace(...)` is not set it falls back
to `${user.dir}/.agentscope/workspace` (see `resolveDefaultWorkspace()`), and several
workspace-backed components are wired unconditionally — the default local filesystem overlay
(`LocalFilesystemSpec`), the workspace-backed `WorkspaceMessageBus` / `WorkspaceAsyncToolRegistry`
fallbacks, the default `WorkspaceTaskRepository` (`agents//tasks`), skills staging
(`.skills-cache`), and (on `main`) transcripts under `workspace/.agentscope/transcripts`.

In a SaaS / containerised deployment where **all file IO happens inside a remote sandbox or an
in-memory / distributed store**, that local workspace is pure dead weight. Even after
`disableFilesystemTools().disableShellTool()` the harness still creates a `.agentscope` tree in
the application's working directory (and the default `JsonFileAgentStateStore` falls back to
`~/.agentscope/state/` when no state store is given). Note the project's own
`.gitignore` already ignores `.agentscope/` — the directory is known to be an unwanted
by-product, but there is no way to prevent it.

The existing escape hatches (`workspace(Path)`, `agentscope.workspace` system property,
`AGENTSCOPE_WORKSPACE` env var) only *relocate* the directory; none of the 15 `disable*`
builder switches stops the local materialisation.

### Proposed solution

Add `HarnessAgent.Builder.disableLocalWorkspace()` (feature PR #…):

- workspace resolves to an ephemeral `${java.io.tmpdir}/agentscope-workspace/` when
`workspace(...)` is unset, never `${user.dir}`;
- no default local filesystem is created (`resolveFilesystem` returns `null`);
- missing explicit `.stateStore(...)` / `.taskRepository(...)` fail fast with descriptive
errors instead of persisting to `~/.agentscope/state` / `agents//tasks`;
- transcripts and skills staging are skipped when there is no local filesystem.

Behaviour is unchanged for everyone who does not call the new switch.

### Environment

- agentscope-java `main` (2.0.3-SNAPSHOT); also present in 2.0.1/2.0.2
- JDK 17+, Windows / Linux

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.