Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,8 @@ public HarnessAgent build() {
if (agentTracingLogEnabled) {
inner.middleware(new AgentTraceMiddleware());
}
boolean artifactDeliveryEnabled =
artifactDeliveryTarget != null && !disableFilesystemTools;
if (!disableWorkspaceContext) {
WorkspaceContextMiddleware markdownMw =
new WorkspaceContextMiddleware(
Expand All @@ -2422,8 +2424,7 @@ public HarnessAgent build() {
disableMemoryTools,
disableMemoryHooks);
markdownMw.setAdditionalContextFiles(additionalContextFiles);
markdownMw.setArtifactDeliveryEnabled(
artifactDeliveryTarget != null && !disableFilesystemTools);
markdownMw.setArtifactDeliveryEnabled(artifactDeliveryEnabled);
inner.middleware(markdownMw);
}
if (!disableAtPathExpansion) {
Expand Down Expand Up @@ -2602,7 +2603,7 @@ public HarnessAgent build() {
if (!disableFilesystemTools) {
agentToolkit.registerTool(new FilesystemTool(filesystem, pathNormalizer));
}
if (artifactDeliveryTarget != null && !disableFilesystemTools) {
if (artifactDeliveryEnabled) {
agentToolkit.registerTool(
new ArtifactDeliveryTool(
filesystem, pathNormalizer, artifactDeliveryTarget));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
*/
public class ArtifactDeliveryTool {

/**
* Registered tool name.
*/
public static final String NAME = "deliver_artifact";

private final AbstractFilesystem filesystem;
private final WorkspacePathNormalizer pathNormalizer;
private final ArtifactDeliveryTarget target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -76,7 +77,7 @@ void deliverArtifact_downloadsBytesAndForwardsToTarget_withDefaults() {
assertEquals("outputs/report.docx", request.filePath());
assertArrayEquals(content, request.content());
assertEquals("report.docx", request.fileName());
assertEquals(null, request.description());
assertNull(request.description());
assertFalse(request.force());
}

Expand Down