Skip to content

task: update v1alpha1 Task and ObjectMeta schema and update codebase - #587

Merged
siyuanfoundation merged 3 commits into
google:mainfrom
siyuanfoundation:task-api
Nov 14, 2026
Merged

siyuanfoundation merged 3 commits into
google:mainfrom
siyuanfoundation:task-api

Conversation

@siyuanfoundation

@siyuanfoundation siyuanfoundation commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #563

I left some fields out like Budget and start_time because they are not necessary for 0.1 and we can add them incrementally.

This just updates the proto and make existing codes functional with the changes. Task still creates one template per task.

  • Update ObjectMeta in common.proto with uid, labels, owner, update_time, and delete_time.
  • Update TaskSpec and TaskStatus in task.proto to match the v1alpha1 API design (profile, commands, goal, retry, session_id; state, status_detail, outcome, attempt, ate_actor_template, generation, resolved_argv, previous_failure), omitting deferred fields and removing deprecated spec.{image,command,resources} and status.{phase,id,worker_ip}.
  • Keep TaskStatusReason minimal (UNSPECIFIED, PROVISIONING_FAILED, SANDBOX_CRASHED) and add buf.build/googleapis/googleapis for google/rpc/status.proto.
  • Replace field-level MergeProfile with whole-profile EffectiveProfile so Task.spec.profile is used as-is when set and falls back to Workspace.spec.profile only when omitted; document warm vs. cold startup semantics across protos, Go docstrings, and docs/manifests.md.
  • Adapt validation, memory/postgres stores, controller, server, runner, claude-code-runner, CLI, E2E harness, examples, and docs end to end.

@siyuanfoundation siyuanfoundation changed the title task: align v1alpha1 Task and ObjectMeta schema and update codebase task: update v1alpha1 Task and ObjectMeta schema and update codebase Nov 13, 2026
@siyuanfoundation
siyuanfoundation requested review from YoyinZyc and yongruilin and removed request for YoyinZyc, mayawang and rakyll November 13, 2026 20:06
@siyuanfoundation

Copy link
Copy Markdown
Collaborator Author

@yongruilin yongruilin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The critical one is for the new Task State: TASK_STATE_QUEUED now means 2 cases which may have potential risk..

Comment thread internal/controller/reconciler.go Resolved
Comment thread internal/apivalidation/task.go Resolved
Comment thread internal/server/server.go Resolved

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Big step, nice to see the Sobi-aligned states land. One ask before approving: this reuses field numbers with new meanings (e.g. TaskSpec 1 was image string, now profile; TaskStatus 1 was phase, now actor). Both are length-delimited, so an older ax CLI against a new server gets misparsed instead of a clean error. Could we reserve the old numbers/names and give the new fields fresh ones? Also worth a release note that existing stored tasks lose image/command/resources and need recreating.

@yongruilin

Copy link
Copy Markdown
Collaborator

Big step, nice to see the Sobi-aligned states land. One ask before approving: this reuses field numbers with new meanings (e.g. TaskSpec 1 was image string, now profile; TaskStatus 1 was phase, now actor). Both are length-delimited, so an older ax CLI against a new server gets misparsed instead of a clean error. Could we reserve the old numbers/names and give the new fields fresh ones? Also worth a release note that existing stored tasks lose image/command/resources and need recreating.

We should still allow breaking changes on the v1alpha1 API for now.

@mayawang

Copy link
Copy Markdown
Collaborator

Totally agree on breaking changes, not asking to keep compatibility. Reserving the old numbers still breaks old clients, it just makes them fail cleanly instead of silently misreading a string as a message. Cheap to do while we're renumbering anyway

@siyuanfoundation

Copy link
Copy Markdown
Collaborator Author

Big step, nice to see the Sobi-aligned states land. One ask before approving: this reuses field numbers with new meanings (e.g. TaskSpec 1 was image string, now profile; TaskStatus 1 was phase, now actor). Both are length-delimited, so an older ax CLI against a new server gets misparsed instead of a clean error. Could we reserve the old numbers/names and give the new fields fresh ones? Also worth a release note that existing stored tasks lose image/command/resources and need recreating.

Thanks for pointing this out. Added reserved field numbers. But we don't have releases/release notes yet. Adding them in plain docs also seems out of the context. So I think just cli apply error should be fine.

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, the reserved numbers look right. Fair on release notes, LGTM

mayawang added a commit that referenced this pull request Nov 14, 2026
* examples: add the v0.1 hero demo harness

Add examples/hero-demo/, one script and three manifests for the 5-step
v0.1 hero demo, so each step's DRI wires their piece into run.sh on main
instead of keeping a separate demo branch.

- run.sh runs the five steps in order and prints a scoreboard
  (PASS / STUB / FAIL). By default it makes no cluster calls. With
  RUN_LIVE_STEPS=1 it runs what works on main today: ax get workspaces,
  ax apply of both manifests, and resume/suspend/resume of the starter
  task; with --remote-context it applies the manifests to that cluster.
  Everything else is a STUB with a TODO(@owner).
- workspace.yaml, task-starter.yaml and task-custom.yaml use the
  v1alpha1 schema on main (metadata.atespace, spec.profile and
  spec.setup on Workspace, spec.image/command/resources/workspace on
  Task; the starter goal goes in spec.config.prompt until #587).
- The setup test is a unittest.TestCase, so the custom task's
  python3 -m unittest discover finds it without pytest.

Verification:
  ./examples/hero-demo/run.sh                        # prints the scoreboard, exit 0
  ./examples/hero-demo/run.sh --step 3
  RUN_LIVE_STEPS=1 AX_BIN=<ax> ./examples/hero-demo/run.sh --remote-context <ctx>
The manifests decode with the strict v1alpha1 YAML decoder and pass
ValidateWorkspace/ValidateTask. Live mode was exercised against stub ax
binaries, not a real cluster.

* hack: move the hero demo harness out of examples

examples/ is where developers learn AX, and this is a development
harness that stays mostly stubs until its pieces land, so it moves to
hack/hero-demo/ next to the other dev and CI scripts.

- The README now just says what the harness does and how to run it.
- TODOs name GitHub handles; Step 2 (warm snapshots) is YoyinZyc.
- The starter image is a registry.example.com placeholder, and the
  workspace uses the server's default task image, instead of
  unpublished image names.

Verification:
  ./hack/hero-demo/run.sh                        # prints the scoreboard, exit 0
  ./hack/hero-demo/run.sh --step 2
  RUN_LIVE_STEPS=1 AX_BIN=<ax> ./hack/hero-demo/run.sh --remote-context <ctx>
The manifests still decode with the strict v1alpha1 YAML decoder and pass
ValidateWorkspace/ValidateTask. Live mode was exercised against stub ax
binaries, not a real cluster.

* hack: name the Step 3 and Studio owners, and use a starter image placeholder

TODOs now name aprajitaarora13 for the Session turn and Raji14 for the
Studio health check. The starter image is <starter-image>@sha256:<digest>,
pointing at github.com/agentexecutor/images, until the first digest is
published.

Verification:
  ./hack/hero-demo/run.sh   # prints the scoreboard, exit 0
The manifests still decode with the strict v1alpha1 YAML decoder and pass
ValidateWorkspace/ValidateTask.
- Update ObjectMeta in common.proto with uid, labels, owner, update_time,
  and delete_time.
- Update TaskSpec and TaskStatus in task.proto to match the v1alpha1 API
  design (profile, commands, goal, retry, session_id; state, status_detail,
  outcome, attempt, ate_actor_template, generation, resolved_argv,
  previous_failure), omitting deferred fields and removing deprecated
  spec.{image,command,resources} and status.{phase,id,worker_ip}.
- Keep TaskStatusReason minimal (UNSPECIFIED, PROVISIONING_FAILED,
  SANDBOX_CRASHED) and add buf.build/googleapis/googleapis for
  google/rpc/status.proto.
- Replace field-level MergeProfile with whole-profile EffectiveProfile so
  Task.spec.profile is used as-is when set and falls back to
  Workspace.spec.profile only when omitted; document warm vs. cold startup
  semantics across protos, Go docstrings, and docs/manifests.md.
- Adapt validation, memory/postgres stores, controller, server, runner,
  claude-code-runner, CLI, E2E harness, examples, and docs end to end.
Signed-off-by: siyuanfoundation <[email protected]>
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