Skip to content

feat: return promises from codemode tool calls - #4487

Merged
rumpl merged 1 commit into
docker:mainfrom
rumpl:feat/codemode-promises
Sep 30, 2026
Merged

rumpl merged 1 commit into
docker:mainfrom
rumpl:feat/codemode-promises

Conversation

@rumpl

@rumpl rumpl commented Sep 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Return a Promise from every codemode tool call and execute tool handlers concurrently, resolving Promises on the single-threaded JavaScript event loop.
  • Support top-level await, Promise.all, Promise.allSettled, and catchable tool failures while retaining ordered tool-call history and cancellation support.
  • Update generated TypeScript declarations, model instructions, and documentation for the asynchronous API.
  • Add tests covering parallel execution, sequential dependencies, Promise callbacks, rejection handling, cancellation, and unavailable handlers.

Existing scripts must await tool results before inspecting or combining them. Started tool calls finish before returning the script response unless execution is cancelled.

Validation

  • task build — passed
  • task lint — passed
  • go test ./pkg/tools/codemode ./pkg/agent ./pkg/runtime — passed
  • go test -race -count=20 ./pkg/tools/codemode — passed
  • WebAssembly codemode tests — passed
  • task test — blocked by TestUsageBackgroundRuntimeRecordsWithoutClientIO in pkg/acp; reproduced on unchanged main in a separate worktree. An initial DMR connection-test timeout passed on the next full-suite run.

@rumpl
rumpl requested a review from a team as a code owner September 30, 2026 10:39
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
@rumpl
rumpl force-pushed the feat/codemode-promises branch from f7c7b91 to e0e0395 Compare September 30, 2026 10:56
@aheritier aheritier added area/docs Documentation changes area/testing Test infrastructure, CI/CD, test runners, evaluation area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Sep 30, 2026
@rumpl
rumpl added this pull request to the merge queue Sep 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 30, 2026
@rumpl
rumpl added this pull request to the merge queue Sep 30, 2026
Merged via the queue into docker:main with commit 07f2a07 Sep 30, 2026
22 checks passed
@rumpl
rumpl deleted the feat/codemode-promises branch September 30, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation changes area/testing Test infrastructure, CI/CD, test runners, evaluation area/tools For features/issues/fixes related to the usage of built-in and MCP tools kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants