Skip to content

fix(core): enable pending tool recovery by default#1182

Open
Alexxigang wants to merge 1 commit intoagentscope-ai:mainfrom
Alexxigang:fix/default-pending-tool-recovery
Open

fix(core): enable pending tool recovery by default#1182
Alexxigang wants to merge 1 commit intoagentscope-ai:mainfrom
Alexxigang:fix/default-pending-tool-recovery

Conversation

@Alexxigang
Copy link
Copy Markdown
Contributor

Summary

  • enable pending tool recovery by default for ReActAgent.Builder
  • keep explicit opt-out behavior unchanged for callers that disable recovery
  • add a restore-from-session regression test that exercises the orphaned tool-call path

Why this fix

When a ReActAgent session is restored with pending tool calls that never produced results, the existing PendingToolRecoveryHook can repair the state before the next call. The builder currently leaves that hook disabled by default, so a normal follow-up message can still fail with IllegalStateException after session restore. Enabling the recovery hook by default matches the documented behavior and preserves explicit opt-out support.

Validation

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:agentscope agent as tools模式下流式场景报错:Cannot add messages without tool results when pending tool calls exist.

1 participant