Skip to content

fix(workflow): preserve complete tool results - #355

Open
PoisonGodv wants to merge 1 commit into
agentic-ai-java:mainfrom
PoisonGodv:fix/workflow-tool-results
Open

PoisonGodv wants to merge 1 commit into
agentic-ai-java:mainfrom
PoisonGodv:fix/workflow-tool-results

Conversation

@PoisonGodv

Copy link
Copy Markdown
Contributor

I acknowledge this contribution to ARGI.

Describe what this PR does / why we need it

Preserve empty, composite, JSON, binary and metadata-bearing successful tool results instead of truncating them to the first text or producing null step outputs; retain ordinary single-text string compatibility.

Does this pull request fix one issue?

Fixes #281.

Describe how you did it

Project complete results into ordered, path-addressable maps/lists and move successful result validation, projection and publication outside invocation retries so result-handling failures cannot replay an already successful tool effect; keep invocation failures and error ToolResult retries. Document downstream paths, migration and runtime boundaries.

Describe how to verify it

The unchanged reviewed implementation passes mvn -B -pl :argi-workflow-core -am clean test: 142 tests, zero failures/errors/skips and zero Checkstyle violations; the same 12-case regression suite produces 2 failures and 7 errors on the baseline. Four independent offline probes pass, covering following-tool mappings, failed-stage retry, cancellation between attempts and parallel outputs. Pinned Java formatting, full make lint, full make licenses-check (1043 valid, 634 ignored, zero invalid) and diff whitespace checks pass.

Special notes for reviews

A metadata-bearing single-text result intentionally becomes structured; consumers selecting its text should use content.0.text. JSON text is preserved rather than parsed; binary argument serialization follows the configured ObjectMapper. The composite representation is proposed for maintainer review. Whole-repository tests, real providers and end-to-end multimodal adapters were not run; failed invocations may already have external effects, so this is not an exactly-once guarantee. AI-assisted implementation and independent local review.

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][P2] Workflow 应正确处理空、多片段及二进制工具结果,避免丢数据和空指针

1 participant