Skip to content

fix(harness): resolve async tool record path without double slash - #3976

Open
pcbeingused33 wants to merge 1 commit into
agentscope-ai:mainfrom
pcbeingused33:fix/async-registry-byid-path
Open

pcbeingused33 wants to merge 1 commit into
agentscope-ai:mainfrom
pcbeingused33:fix/async-registry-byid-path

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

Fixes #3975

AgentScope-Java Version

2.1.0-SNAPSHOT (main)

Description

Root cause: RemoteFilesystem.ls() returns directory entries with a trailing slash, so WorkspaceAsyncToolRegistry.findRecordPath built <root>/<session>//<id>.json. exists() never matched the stored key, findRecordPath returned null and updateStatus returned early without logging. The by-id complete / fail / markTimeout overloads were therefore silent no-ops on a RemoteFilesystem, leaving records RUNNING until findStale reported them as timed out.

Fix: strip the trailing slash from the session directory path before appending <id>.json in findRecordPath (the minimal option suggested in the issue).

Test: WorkspaceAsyncToolRegistryTest.byIdUpdatesWorkOnRemoteFilesystem registers three stale records on a RemoteFilesystem over an InMemoryStore, resolves them through complete / fail / markTimeout and asserts findStale is empty. It fails before the change and passes after.

Checklist

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test) — WorkspaceAsyncToolRegistryTest was run (7 passed); the full suite was not
  • Javadoc comments are complete and follow project conventions — no public API change
  • Related documentation has been updated (e.g. links, examples, etc.) — not applicable
  • Code is ready for review

This change was prepared with the assistance of an AI coding tool (Claude Code).

RemoteFilesystem.ls() returns directory entries with a trailing slash, so
WorkspaceAsyncToolRegistry.findRecordPath built <root>/<session>//<id>.json.
exists() never matched the stored key and the by-id complete/fail/markTimeout
overloads silently did nothing, leaving records RUNNING. Strip the trailing
slash before appending the record file name.

Fixes agentscope-ai#3975

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@jujn jujn added the P1 紧急不重要 label Nov 7, 2026

This branch has not been deployed

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

Labels

P1 紧急不重要

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: WorkspaceAsyncToolRegistry by-id terminal updates silently no-op (double-slash record path from ls trailing slashes)

2 participants