fix(code): preserve JavaScript subagent costs across resume - #6433
Conversation
|
Related upstream work: langchain-ai/langgraph#8819 (currently an open draft) proposes This looks worth coordinating with as a path to removing the namespace/scratchpad manipulation here. It is not a drop-in replacement: this JavaScript bridge directly invokes the The cost receipts and cancellation settlement would still be needed; stable child identity alone does not preserve spending when a child fails before returning. Separately, we could reduce private API use by passing the existing saver explicitly and setting public |
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
b50fc76 to
cbf1860
Compare
> [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Release notes preview: keep this section in sync with the package `CHANGELOG.md`. Publish reads the merged CHANGELOG via `release.yml`, not this PR description — keep them aligned anyway so the PR stays an accurate historical record for reviewers and anyone returning later._ --- ## [0.1.79](deepagents-code==0.1.78...deepagents-code==0.1.79) (2026-09-29) ### Bug Fixes - MCP tool calls now use configurable timeouts to prevent them from hanging indefinitely ([#6625](#6625)). - Stdio MCP servers now start in the session directory ([#6626](#6626)). - JavaScript subagent costs are preserved when resuming a session ([#6433](#6433)). - Thread switching now completes its preflight faster and shows progress sooner ([#6607](#6607)). - The `/effort` setting is now constrained for between-tools thinking ([#6630](#6630)). - CLI help now displays the same defaults used at runtime ([#6613](#6613)). - The incognito label now appears on the chat input border ([#6627](#6627)). _End release notes preview._ --- > [!NOTE] > A **community contributors** list and a **Special thanks** section (crediting the users who filed the issues this release's PRs closed) are appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 3). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: langchain-oss-automated-triage[bot] <248757908+langchain-oss-automated-triage[bot]@users.noreply.github.com>
Session costs retain JavaScript subagent spending across interruptions, resumes, failures, and nested cancellation without replaying cached JavaScript task results.
deepagents-code: only owned cost transfers reach parent state; child messages and unrelated state remain isolated.langgraph.func.taskresults. Parallel completion order cannot exchange results for different requests. Direct task calls and structured output stay intact.This covers the async interpreter with a checkpointer, including reopened SQLite checkpoints. Receipts use the existing saver and thread retention, with one additional checkpoint per priced node and an eval-scoped metadata query. Arbitrary JavaScript side effects are not exactly-once; identical requests remain occurrence-ordered, and nondeterministic scripts are not made replay-safe. The adapter relies on LangGraph's private namespace/scratchpad configuration. It does not recover provider usage lost before pricing/persistence, and synchronous interpreter accounting is unchanged.
Made by Open SWE · view thread · openai:gpt-5.6-sol (medium)