Skip to content

fix(harness): avoid local files in remote mode#2184

Open
guslegend0510 wants to merge 1 commit into
agentscope-ai:mainfrom
guslegend0510:fix/2182-remote-workspace-no-local-cache
Open

fix(harness): avoid local files in remote mode#2184
guslegend0510 wants to merge 1 commit into
agentscope-ai:mainfrom
guslegend0510:fix/2182-remote-workspace-no-local-cache

Conversation

@guslegend0510

Copy link
Copy Markdown
Contributor

Summary

  • Stop creating .index/workspace.db by default when using RemoteFilesystemSpec.
  • Disable local Harness session transcript files for remote main agents and subagents.
  • Keep AgentStateStore persistence unaffected.
  • Make disableSessionPersistence() cover both memory-flush and compaction offload paths.
  • Allow callers to explicitly provide a caller-managed WorkspaceIndex when needed.
  • Fall back to distributed-store scans when no local workspace index is configured.

Testing

  • HarnessAgentTest: 39 tests passed
  • Core test suite: 2209 tests passed, 9 skipped
  • Harness test suite: 643 tests passed, 3 skipped
  • Spotless and git diff --check passed

Fixes #2182

@guslegend0510 guslegend0510 requested a review from a team July 14, 2026 02:12
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

@oss-maintainer oss-maintainer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Fixes remote deployments creating host-local transcript caches. When remoteFilesystemSpec is set, session persistence is now disabled to avoid duplicate storage.

Findings

  • [Info] HarnessAgent.java:2044-2048 — Added sessionTranscriptEnabled flag based on remoteFilesystemSpec. Correct.
  • [Info] CompactionMiddleware.java and MemoryFlushMiddleware.java — Both now accept sessionPersistenceEnabled parameter. Good separation of concerns.
  • [Info] ConversationCompactor.java:156 — Offload step skipped when persistence disabled. Prevents redundant writes.

Verdict

Important fix for remote deployments. LGTM.


Automated review by github-manager

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Well-designed fix for issue #2182 that prevents unnecessary local file creation when using RemoteFilesystemSpec. Three key changes: (1) stops auto-creating .index/workspace.db; (2) disables local session transcripts for remote agents; (3) allows explicit WorkspaceIndex injection when needed. The AgentStateStore persistence path is correctly left unaffected.

All four new tests pass and cover the key scenarios. The sub-agent propagation logic is correct. The fallback to distributed-store scans when no local index exists is properly guarded.

One suggestion: since this is a behavioral change (previously local index was auto-created), consider noting it in release notes so users who relied on the old behavior can explicitly opt in via .workspaceIndex(WorkspaceIndex.open(workspace)).

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Well-designed fix for issue #2182 that prevents unnecessary local file creation when using RemoteFilesystemSpec. Three key changes: (1) stops auto-creating .index/workspace.db; (2) disables local session transcripts for remote agents; (3) allows explicit WorkspaceIndex injection when needed. The AgentStateStore persistence path is correctly left unaffected.

All four new tests pass and cover the key scenarios. The sub-agent propagation logic is correct. The fallback to distributed-store scans when no local index exists is properly guarded.

One suggestion: since this is a behavioral change (previously local index was auto-created), consider noting it in release notes so users who relied on the old behavior can explicitly opt in via .workspaceIndex(WorkspaceIndex.open(workspace)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/harness agentscope-harness (test/runtime support) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:使用DistributedStore和filesystem仍然本地会创建.agentscope/workspace/.index/workerspace.db和alice文件

3 participants