Skip to content

feat(jobs): artifact download + object artifact-refs (run402:// retired)#421

Merged
MajorTal merged 1 commit into
mainfrom
claude/quirky-varahamihira-90c932
Jun 2, 2026
Merged

feat(jobs): artifact download + object artifact-refs (run402:// retired)#421
MajorTal merged 1 commit into
mainfrom
claude/quirky-varahamihira-90c932

Conversation

@MajorTal
Copy link
Copy Markdown
Collaborator

@MajorTal MajorTal commented Jun 2, 2026

Implements #420 (gateway side: run402-private #448).

What changed

The gateway added GET /jobs/v1/runs/:job_id/artifacts/:filename and changed the managed-jobs artifacts response from bare run402:// ref strings to objects { url, content_type, sha256, size_bytes } (sha256/size_bytes omitted for pre-change jobs; url still serves). The never-resolvable run402://storage/... scheme is retired. This PR surfaces both across every interface.

  • SDK (sdk/src/namespaces/jobs.ts): new ManagedJobArtifact type; ManagedJobResponse.artifacts is now Record<string, ManagedJobArtifact>; jobs.downloadArtifact(projectId, jobId, filename) → Response (service-key auth; ApiError on 404). Scoped wrapper r.project(id).jobs.downloadArtifact(jobId, filename).
  • MCP (src/tools/jobs.ts, src/index.ts): jobs_download_artifact tool — writes bytes to output_path (mirrors assets_get).
  • CLI / OpenClaw (cli/lib/jobs.mjs): run402 jobs artifacts get <job_id> <file> --output <path> (nested group, mirroring deploy release).
  • Docs: cli/llms-cli.txt, SKILL.md, openclaw/SKILL.md.

Since the MCP/CLI echo gateway JSON, "stop printing run402://" is automatic — the repo never parsed the scheme; the type change is the contract update.

Tests / verification

  • npm test → 613 pass, 0 fail; doc snippets compile.
  • New SDK + MCP unit tests (success, 404, project-not-found, percent-encoding). sync.test.ts SURFACE + SDK_BY_CAPABILITY + nested-action parser; cli-help.test.mjs nested-group coverage; scoped.test.ts drift wrapper.
  • End-to-end against a local mock: success writes the bytes + prints { job_id, filename, project_id, output, content_type, size_bytes } with correct Bearer auth on the right path; 404 returns a structured error envelope.

Closes #420

🤖 Generated with Claude Code

Gateway (run402-private #448) added GET /jobs/v1/runs/:job_id/artifacts/:filename
and changed the managed-jobs `artifacts` response from bare run402:// ref strings
to { url, content_type, sha256, size_bytes } objects (sha256/size_bytes omitted
for pre-change jobs). Surface the new endpoint + shape across every interface.

- SDK: ManagedJobArtifact type; artifacts is Record<string, ManagedJobArtifact>;
  jobs.downloadArtifact(projectId, jobId, filename) -> Response; scoped wrapper.
- MCP: jobs_download_artifact tool (writes bytes to output_path).
- CLI/OpenClaw: run402 jobs artifacts get <job_id> <file> --output <path>.
- Tests: SDK + MCP unit tests, sync SURFACE/SDK map + nested-action parser,
  cli-help nested-group coverage.
- Docs: cli/llms-cli.txt, SKILL.md, openclaw/SKILL.md.

Closes #420

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MajorTal MajorTal merged commit f102229 into main Jun 2, 2026
4 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.

Jobs API: add artifact download + update artifact-ref shape (run402:// retired)

1 participant