Skip to content

feat: support Platform API 1.200 features (agent launch and runs, lineage, studio logs) - #691

Closed
cristianrcv wants to merge 7 commits into
feat/NOTASK-api-1.190-catch-upfrom
feat/NOTASK-api-1.200-catch-up
Closed

cristianrcv wants to merge 7 commits into
feat/NOTASK-api-1.190-catch-upfrom
feat/NOTASK-api-1.200-catch-up

Conversation

@cristianrcv

Copy link
Copy Markdown
Contributor

Summary

Exposes features introduced in Platform API 1.200.0: agent launch and agent runs, lineage, studio logs, and per-user CPU / spot-attempt limits for Intelligent Compute.

This is one PR in a stack that catches tw up with Platform API 1.230.0, one PR per API version that introduced the features. Each PR adds the items whose API elements all exist in that version.

Changes

  • feat(agents): add agents launch (35fb0cd)
  • feat(agents): add agents runs list and view (2b44552)
  • feat(lineage): add lineage command (168e202)
  • feat(studios): add logs (4664673)
  • feat(compute-envs): add per-user CPU and spot attempt limits to Intelligent Compute (8bcc192)
  • docs: document the commands added for API 1.200 (596fd3e)
  • build(native): register reflection metadata for the API 1.200 commands (aab0fa9)

Notes for review

  • agents launch: it's here rather than in the 1.190 PR because it reads LaunchAgentResponse.agentRunId, which first appears in 1.200 (1.190 servers send agentId).
  • lineage resolve: takes --session-id or --file-path. --run-name (API 1.211) comes with the 1.230 PR. API 1.211+ requires runName with sessionId, so until that PR lands, resolving by session gets a 400 from 1.211+ servers (prod runs 1.226).
  • Reading LogPage.entries: SDK 1.200.0 types it as Object, so studios logs reads it as a list, the same way runs view log does.

Verification

  • ./gradlew test: 950 tests, 0 failures. Every new command and option has MockServer tests that assert the request (method, path, query, body) and the output.
  • Each item was checked against the OpenAPI spec of this version and the previous one (tower-sdk-gencode history) to confirm where it first appears.
  • CI runs the full suite against the native binary on Linux, macOS and Windows.

🤖 Generated with Claude Code

cristianrcv and others added 7 commits October 2, 2026 19:12
Platform API 1.190.0 added agent launch, but tw had no command for it.
tw agents launch starts a background run from a configured agent
(--id or --name), from ad hoc instructions, or both. Launching a
configured agent sends its stored instructions, like the web UI does.

The command reads LaunchAgentResponse.agentRunId, which API 1.200.0
introduced: 1.190 servers send agentId instead, so the run id would
print as null against them. That is why launch ships with 1.200
rather than with the rest of the agents command.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Platform API 1.200.0 added agent run listing and run status, but tw
had no command for them. tw agents runs list pages through a
workspace's runs, newest first, with the API's keyword filter, and
tw agents runs view shows a run's status, thread and session.

The filter help lists only the keywords API 1.200 accepts; the
service-account keywords came later.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Platform API 1.200.0 added read-only lineage endpoints (resolve,
search, record, summary, upstream, downstream) that tw did not expose.

tw lineage resolve turns a run (session ID) or a file path into its
LID; view shows a record, or its index summary with --summary; search
runs the cross-workspace query DSL with token paging; upstream and
downstream walk one data-flow hop, optionally filtered by record type.
LIDs are double-encoded in the path, as the web UI does, because the
API decodes them twice to survive proxy path normalization.

API 1.200 resolves a run by session ID alone. The run name parameter,
the pipeline search qualifiers and the record's pipeline name came in
later API versions, so they are not offered here.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Platform API 1.200.0 added the studio session log endpoint, but tw
had no way to read it. tw studios logs prints the process log of the
latest session of a studio, one page at a time: --next takes the
cursor printed at the end of the previous page and --max-length caps
the characters returned.

SDK 1.200.0 types LogPage.entries as Object (the spec declares an
Iterator) while Platform sends a JSON array, so the log entries are
read as a List, as tw runs view log does. The test compares against
the platform line separator, since println writes CRLF on Windows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ligent Compute

Platform API 1.200.0 added maxCpusPerUser and maxSpotAttempts to the
Seqera scheduler configuration, but tw could not set them.

tw compute-envs add aws-cloud, azure-cloud and google-cloud gain
--max-cpus-per-user, which caps the vCPUs one user may hold across
their runs, and --max-spot-attempts, which bounds the spot attempts
per task before giving up on spot capacity (falling back to
on-demand with SPOT_FIRST). Both join the Intelligent Compute option
group of each platform.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Agents section gains launch and runs list|view, a Lineage section
follows it, and the studios entry in 'Other additions' gains logs.
Examples use bash code blocks, as markdownlint MD014 rejects
$-prompted blocks that show no output.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Native images only see the picocli option fields and the Jackson
response fields that reflect-config.json lists. These entries, for
agents launch and runs, lineage and studios logs, come from the
tracing agent run of the full suite on the 1.230 branch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@educalleja

Copy link
Copy Markdown

@t0randr tagging you in this PR since it contains changes for lineage and studios.

@educalleja
educalleja requested a review from t0randr October 5, 2026 13:31
@educalleja

Copy link
Copy Markdown

Tagging @vpatel85 since this PR seems to have tw-cli changes for agents which is owned by Growth and AI

@cristianrcv

Copy link
Copy Markdown
Contributor Author

Superseded by #700 (API 1.200). Agent launch and agent runs from this PR moved to #702 (agents).

The stack is now: #685 (1.101) → #686 (1.113) → #697 (1.145) → #698 (1.167) → #699 (1.190) → #700 (1.200) → #701 (1.230) → #702 (agents) → #703 (actions). The code at the top of the stack is identical to the old one; only the grouping changed. Agents and actions changes are grouped into one PR each instead of being spread across API versions. New branches were used instead of force-pushing.

@cristianrcv cristianrcv closed this Oct 5, 2026
@cristianrcv
cristianrcv removed this pull request from stack #693 October 5, 2026 16:19
@cristianrcv
cristianrcv deleted the feat/NOTASK-api-1.200-catch-up branch October 8, 2026 09:09
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.

2 participants