Skip to content

cli, e2e, hero-demo: add ax fork task and wire Step 3 Turn 2 session reuse - #670

Open
aprajitaarora13 wants to merge 1 commit into
aprajitaarora/fork-task-apifrom
aprajitaarora/fork-task-cli-demo
Open

aprajitaarora13 wants to merge 1 commit into
aprajitaarora/fork-task-apifrom
aprajitaarora/fork-task-cli-demo

Conversation

@aprajitaarora13

Copy link
Copy Markdown
Collaborator

Part 2 of #649 (stacked on the ForkTask API/server PR).

Adds the ax fork CLI command, Kind E2E coverage for multi-turn snapshot forking, and Step 3 Turn 2 session reuse in hack/hero-demo/:

  • CLI (cmd/ax/fork.go, cmd/ax/main.go, cmd/ax/task.go):
    • Adds ax fork task <source-task> <new-task> [--goal] [--session-id] [--env KEY=VALUE] [--label KEY=VALUE] [--no-resume] [-- command...], creating the forked task and resuming it by default unless --no-resume is set.
    • Prints Parent Task in ax describe task when populated.
    • Adds unit tests in cmd/ax/fork_test.go.
  • E2E (test/e2e/launcher/ax-harness, test/e2e/launcher_test.go):
    • Extends TestE2E_PureImageLauncher to fork Turn 2 from Turn 1's parked snapshot via ax fork task, verifying that Turn 2 inherits spec.sessionId, sees Turn 1's workspace state (runs=2), completes with the new goal, and cleans up its snapshot tag on ax delete task.
  • Hero Demo (hack/hero-demo/run.sh, hack/hero-demo/README.md):
    • Updates Step 3 to wait on pull-mode Completed + TASK_RESULT_SUCCEEDED + Output rather than polling /workspace/.ax/launcher-done, forks Turn 2 (hero-demo-starter-task-turn2) from Turn 1 reusing hero-demo-session, verifies Turn 2 completes with inherited Session ID and Parent Task, and marks Step 3 PASS.

Closes #649.

Verified:

  • make verify (golangci-lint: 0 issues).
  • go test ./cmd/ax/... passes.
  • bash -n hack/hero-demo/run.sh and ./hack/hero-demo/run.sh --step 3 pass.

@mayawang

Copy link
Copy Markdown
Collaborator

Same as #669, holding until we settle the API on #649

@yongruilin

Copy link
Copy Markdown
Collaborator

I don't think we should add a "fork" now as we haven't pinned down the exact design of Task inheritance lineage.

@rakyll

rakyll commented Nov 23, 2026

Copy link
Copy Markdown
Member

Agreed, let's come back to this in 0.5.0.

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.

4 participants