Skip to content

feat(agents): Prepare hosted files and download turn artifacts - #1130

Merged
apcha-oai merged 12 commits into
mainfrom
apcha/beta-agents-files
Oct 1, 2026
Merged

apcha-oai merged 12 commits into
mainfrom
apcha/beta-agents-files

Conversation

@apcha-oai

@apcha-oai apcha-oai commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Prepare files for a hosted Agent and download the artifact from the turn that produced it, without assembling uploads, environment references, and paginated artifact searches by hand.

Before:

var upload = client.files().create(FileCreateParams.builder()
    .file(Paths.get("source.pdf")).purpose(FilePurpose.USER_DATA).build());
var files = List.of(HostedEnvironmentFileParam.ofFileId(
    HostedEnvironmentFileParam.FileId.builder()
        .fileId(upload.id()).path("/workspace/source.pdf").build()));
// Build the hosted environment, run the turn, then search every artifact page
// for the matching session, turn and path before downloading its content.

After:

var prepared = AgentEnvironmentFiles.prepare(client,
    Map.of("/workspace/source.pdf", Paths.get("source.pdf")));
var environment = EnvironmentParam.OpenAIHosted.builder()
    .files(prepared.files()).build();
// Create the session with this environment and collect its result.
AgentArtifactDownloads.forResult(client.beta().agents().sessions().artifacts(), result)
    .download("/workspace/outputs/report.md", Paths.get("report.md"));

The beta helpers also accept explicit directory include globs, stage an upload into an existing environment, and support async clients. Preparation checks selected local paths before uploading, leaves upload limits to the API, and returns upload IDs for explicit cleanup; partial failures retain known IDs. Downloads resolve the exact turn/path across pages and preserve request options. Use .content(path) for the native response (including in-memory reads), or .download(path, destination) for an application-owned destination. Local upload paths assume application-owned files and stable source directories; uploaded contents may still be user-provided.

This PR now targets main directly. Reattachment/result recovery is deferred: a silent attachment cannot reliably distinguish pending work from an already-completed turn, so these helpers do not depend on SDK-side recovery heuristics.

Stack

@apcha-oai
apcha-oai requested a review from a team as a code owner October 1, 2026 02:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T21:58:26.077097Z d119529 New commits
🔒 Security Review ✅ Completed 2026-10-01T22:01:03.620407Z d119529 New commits

Security findings

Advisory findings (3)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@apcha-oai
apcha-oai changed the base branch from apcha/beta-agents-reattach to main October 1, 2026 02:10
@openai-sdks

openai-sdks Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 16.665s for Java SDK PR #1130.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 318ms
tests/chat-completions-create.test.ts ✅ Passed 581ms
tests/chat-completions-stream.test.ts ✅ Passed 450ms
tests/files-content-binary.test.ts ✅ Passed 258ms
tests/files-create-multipart.test.ts ✅ Passed 293ms
tests/files-list-pagination.test.ts ✅ Passed 250ms
tests/initialize-config.test.ts ✅ Passed 137ms
tests/instance-isolation.test.ts ✅ Passed 146ms
tests/models-list.test.ts ✅ Passed 316ms
tests/responses-background-lifecycle.test.ts ✅ Passed 255ms
tests/responses-body-method-errors.test.ts ✅ Passed 432ms
tests/responses-cancel-timeout.test.ts ✅ Passed 222ms
tests/responses-cancel.test.ts ✅ Passed 333ms
tests/responses-compact-retries.test.ts ✅ Passed 261ms
tests/responses-compact.test.ts ✅ Passed 305ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 327ms
tests/responses-create-advanced.test.ts ✅ Passed 1.643s
tests/responses-create-disconnect.test.ts ✅ Passed 1.179s
tests/responses-create-errors.test.ts ✅ Passed 298ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 285ms
tests/responses-create-retries.test.ts ✅ Passed 249ms
tests/responses-create-stream-failures.test.ts ✅ Passed 1.601s
tests/responses-create-stream-timeout.test.ts ✅ Passed 212ms
tests/responses-create-stream-wire.test.ts ✅ Passed 6.433s
tests/responses-create-stream.test.ts ✅ Passed 87ms
tests/responses-create-terminal-states.test.ts ✅ Passed 375ms
tests/responses-create-timeout.test.ts ✅ Passed 210ms
tests/responses-create.test.ts ✅ Passed 293ms
tests/responses-delete.test.ts ✅ Passed 253ms
tests/responses-input-items-errors.test.ts ✅ Passed 292ms
tests/responses-input-items-list.test.ts ✅ Passed 283ms
tests/responses-input-items-options.test.ts ✅ Passed 433ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 195ms
tests/responses-input-tokens-count.test.ts ✅ Passed 307ms
tests/responses-malformed-inputs.test.ts ✅ Passed 5.344s
tests/responses-not-found-errors.test.ts ✅ Passed 383ms
tests/responses-parse.test.ts ✅ Passed 446ms
tests/responses-retrieve-retries.test.ts ✅ Passed 334ms
tests/responses-retrieve.test.ts ✅ Passed 226ms
tests/responses-stored-method-errors.test.ts ✅ Passed 1.047s
tests/retry-behavior.test.ts ✅ Passed 3.48s
tests/sdk-error-shape.test.ts ✅ Passed 457ms

View OkTest run #36931858795

SDK merge (381e481f9096) · head (d1195290a8c0) · base (e3b78a3089c6) · OkTest (92ff272954a1)

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

93 mixed files remain; 0 existing customizations changed.

Compared e3b78a3089c6 → d1195290a8c0. Generated baselines verified.

93 existing customizations unchanged
  • openai-java-core/src/main/kotlin/com/openai/models/audio/AudioResponseFormat.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuth.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthCreateParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponse.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStreamEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesServerEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageFunctionToolCall.kt
  • openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolMessageParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/embeddings/Embedding.kt
  • openai-java-core/src/main/kotlin/com/openai/models/embeddings/EmbeddingCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCall.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionWebSearch.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseStreamEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseTextConfig.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesServerEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/videos/Video.kt
  • openai-java-core/src/main/kotlin/com/openai/models/webhooks/UnwrapWebhookEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/webhooks/WebhookEndpointWithSecret.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/ResponseServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/ResponseServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/SkillServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/VideoServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/WebhookServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/WebhookServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranscriptionServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranslationServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/beta/agents/SessionServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/beta/agents/SessionServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/chat/ChatCompletionServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/finetuning/checkpoints/PermissionServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/skills/VersionServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/blocking/BetaService.kt

53 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 36932146783 --repo openai/openai-java \
  --name castiron-custom-code-36932146783-1 --dir /tmp/castiron-custom-code-36932146783-1
git apply --stat /tmp/castiron-custom-code-36932146783-1/custom-code.patch
cat /tmp/castiron-custom-code-36932146783-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin e3b78a3089c618235eed12289b9b8f8113e5d3d0 d1195290a8c0a0df69e9172ca032266f64da440b
python3 scripts/castiron/custom_code_report.py report \
  --base e3b78a3089c618235eed12289b9b8f8113e5d3d0 \
  --head d1195290a8c0a0df69e9172ca032266f64da440b --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-d1195290a8c0
cat /tmp/castiron-custom-code-d1195290a8c0/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d4caa8a37

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 47d95dd266

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f779d3690

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@apcha-oai
apcha-oai changed the base branch from main to apcha/beta-agents-reattach October 1, 2026 03:00
@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-files branch from bd1a953 to 5bd07cb Compare October 1, 2026 14:45
@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-reattach branch from 438d854 to 0649165 Compare October 1, 2026 14:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5bd07cb767

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-reattach branch from 0649165 to a21cb33 Compare October 1, 2026 14:57
@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-files branch from 5bd07cb to 880b54d Compare October 1, 2026 14:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 880b54d54e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-reattach branch from a21cb33 to eb641f6 Compare October 1, 2026 15:25
@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-files branch 2 times, most recently from 2bcf8f7 to 05f56d6 Compare October 1, 2026 15:35
@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-reattach branch 2 times, most recently from 048963c to fccc185 Compare October 1, 2026 16:27
@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-files branch from 05f56d6 to badc14b Compare October 1, 2026 16:27
@apcha-oai apcha-oai changed the title feat(agents): [3/n] Prepare hosted files and download turn artifacts feat(agents): Prepare hosted files and download turn artifacts Oct 1, 2026
@apcha-oai
apcha-oai force-pushed the apcha/beta-agents-files branch from badc14b to 721372c Compare October 1, 2026 18:37
@apcha-oai
apcha-oai changed the base branch from apcha/beta-agents-reattach to main October 1, 2026 18:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 721372cc93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@apcha-oai

Copy link
Copy Markdown
Contributor Author

@codex review pls

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04ffa17d7c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 04ffa17d7c

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@apcha-oai

Copy link
Copy Markdown
Contributor Author

@codex review pls

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 88435565c6

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88435565c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7497c9ec1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bea0dbc92b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 388c5b8613

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 388c5b8613

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 741a41c5. Two changes remain before approval: keep directory selection from failing on excluded subtrees, and split the new 1,280-line test suite along the existing preparation/staging and artifact-download boundaries. Details are inline.

Validation: source/test review, including cancellation, stream ownership and path handling; 11 exact-head hosted checks passed, one skipped, and both Castiron statuses passed. No local tests or live API validation were run.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: d1195290a8

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the follow-up at d1195290. The split into environment-file and artifact-download suites resolves the test-organization finding. One correctness issue remains: discovery errors can silently remove paths that explicitly match the requested selection; details are inline.

Validation: immutable source and test review, plus 11 successful exact-head hosted checks, one skipped queue check, and both successful Castiron statuses. No repository workloads or live API smoke tests were run locally.

}

override fun visitFileFailed(path: Path, error: IOException): FileVisitResult {
if (path == root) throw error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Preserve failures for paths that match the requested selection

visitFileFailed also receives paths whose attributes could not be read, so returning CONTINUE for every descendant silently drops explicitly selected files. For example, on POSIX as an unprivileged user, let root/private/data.txt exist and make private readable but not searchable (mode 0400); include = listOf("private/data.txt") can enumerate the name but cannot stat it, reaches this callback, and returns a successful empty preparation. The new test only removes read permission from the file itself, whose attributes remain readable, so it exercises the later upload failure instead.

Please propagate failures for matching paths and for failed subtrees that could contain requested matches; only ignore discovery failures when the path is provably unrelated to the includes. A conservative fallback is fine; this does not require a full glob-pruning engine. Cover the matching-entry/required-subtree cases in both blocking and async helpers. Documenting blanket best-effort enumeration still leaves callers unable to tell that their requested input set is incomplete.

@apcha-oai
apcha-oai added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 47add84 Oct 1, 2026
14 checks passed
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.

3 participants