feat(harness): allow direct artifact delivery without host buffering - #3031
feat(harness): allow direct artifact delivery without host buffering#3031q827505931 wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
Introduces an opt-in DirectArtifactDeliveryTarget SPI plus a metadata-only ArtifactDeliverySource, so a sandbox can upload large artifacts without pulling bytes through the host JVM. Clean, backwards-compatible design: the existing byte path is untouched, the tool keeps result == null handling, and no fallback on failure is the right default. Tests cover the no-download guarantee, defaults, and the invalid-input short-circuit. Left two non-blocking notes on SPI discoverability and the source-existence contract.
Automated review by github-manager-bot
ce02173 to
399986c
Compare
|
Addressed the two review notes in 399986c: direct targets are now explicitly documented as supported only through the registered |
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
Re-review after the follow-up commits — both points from the previous pass are resolved, and resolved in the way that fits an SPI best: the contract is now written down instead of being left to inference. DirectArtifactDeliveryTarget's type javadoc states that direct targets are supported only by the framework's deliver_artifact tool and that the inherited byte-based deliver returns a failure because it has no source filesystem, the @param source javadoc says the normalized path is not guaranteed to exist and puts existence/size/force-conflict enforcement on the implementation, HarnessAgent.Builder#artifactDeliveryTarget repeats the restriction where a target is wired, and both the EN and ZH sandbox.md sections carry the same caveats (no automatic byte fallback after a failure, normalized path ≠ sandbox-native path, quote paths for shell uploads, keep credentials out of tool output). The added directTarget_byteBasedEntryPointReturnsFailure test pins the documented behavior rather than just the happy path.
Findings
None blocking. Nothing in the new delta changes the dispatch logic itself, so the previously-reviewed behavior (instanceof dispatch, no fallback, validation before either branch) stands as reviewed.
Suggestions
Two optional follow-ups, neither worth holding the PR for:
- If the direct path turns out to need a size cap in practice, the framework has no lever today since it never sees the bytes — a
long maxBytesHint()on the SPI (defaulting to unlimited, documented as advisory) would give a later enforcement point without breaking this contract. - A
//noinspection-style pointer fromArtifactDeliveryTarget's javadoc toDirectArtifactDeliveryTargetwould make the two implementations discoverable from either side; right now only the direct interface cross-references both.
CI is green on the current head and the CLA is signed. Thanks for the quick, thorough turnaround on the feedback, and for keeping the docs and ZH/EN guides in step with the code.
Automated review by github-manager-bot
AgentScope-Java Version
2.0.3-SNAPSHOT
Description
deliver_artifactcurrently downloads every artifact into a host JVMbyte[]before calling the application target. A sandbox capable of uploading directly must therefore send large files through the host first.Add an opt-in
DirectArtifactDeliveryTargetand metadata-onlyArtifactDeliverySource. The tool dispatches direct targets with the active filesystem and runtime context before any download. Applications can perform the upload inside their sandbox using a backend SDK or shell. Existing byte-based targets, lambdas, and builder configuration remain compatible.Both paths share filename validation and success/error/conflict rendering. Direct failures never trigger an in-memory fallback. Source checks, backend path resolution (including overlays/routing), destination conflict enforcement, and actual transport remain application responsibilities; this PR does not add a provider-specific uploader. English and Chinese docs include an integration example and explain these boundaries.
Closes #3030
Validation
mvn -pl agentscope-harness -am spotless:apply test -Dtest=ArtifactDeliveryToolTest,HarnessAgentTest -Dsurefire.failIfNoSpecifiedTests=falsegit diff --checkpassed.Checklist
mvn spotless:applymvn test) — focused reactor tests above passed; full repository suite not run