Treat blank spawn_agent session IDs as absent - #60893
Merged
bennetbo merged 8 commits intoJul 24, 2026
Merged
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @nevo-ts on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
Contributor
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
nevo-ts
force-pushed
the
fix/spawn-agent-empty-session-id
branch
from
July 13, 2026 12:08
568ab6e to
0999dff
Compare
bennetbo
reviewed
Jul 24, 2026
Member
There was a problem hiding this comment.
Thanks! Altered the prompt wording a bit but looks good!
#60893 (comment)
bennetbo
reviewed
Jul 24, 2026
bennetbo
approved these changes
Jul 24, 2026
bennetbo
enabled auto-merge
July 24, 2026 13:54
mdz-axo
added a commit
to mdz-axo/zed-kask
that referenced
this pull request
Jul 25, 2026
Upstream changes (zed-industries/zed main, 27 commits): - agent: Add agent.compaction_model setting for context compaction (zed-industries#60012) - agent: Show effort selector for anthropic compatible providers (zed-industries#61579) - acp: Update agent-client-protocol SDK to 2.0.0 (zed-industries#61570) - client: Extract proxy handshakes into new proxy_handshake crate (zed-industries#61427) - collab: Fix multiworkspace location out of sync bugs (zed-industries#61598) - editor: Fix sticky header drag cancels autoscroll (zed-industries#53592) - editor: Fix crash when copying and pasting using multiple cursors (zed-industries#61545) - editor: Skip untitled buffers when saving a multi-buffer (zed-industries#61380) - gpui: Fix images not being drawn with rounded corners with ObjectFit::Cover (zed-industries#61383) - gpui: Fix deadlock in performance profiler and reenable it (zed-industries#61584) - git_ui: Prevent Git panel bindings in repository selector (zed-industries#61282) - language_model: Add explicit OpenAI conversation compaction and fix Anthropic compaction (zed-industries#61370) - markdown: Fix squashed Mermaid diagrams in markdown preview (zed-industries#61260) - Opus 5 BYOK Support (zed-industries#61596) - repl: Show add-cell controls in empty notebooks (zed-industries#61329) - search: Escape seeded buffer search query in regex mode (zed-industries#57748) - settings: Fix VS Code import appending duplicate file associations (zed-industries#61355) - settings: Split VSCode and Zed keymap files (zed-industries#61532) - Treat blank spawn_agent session IDs as absent (zed-industries#60893) - worktree: Reload git state when a watcher rescan covers a repository (zed-industries#61541) - Plus 7 more minor fixes. Merge fixes: - crates/agent/src/thread.rs: replay_tool_call used 'message_ix' (undefined) after auto-merge; renamed to 'owning_message_ix' (the parameter name). - Cargo.toml: Removed stale workspace members hkask-wallet and hkask-git-cas (both directories deleted in prior commits but workspace entries remained). - kask/crates/hkask-regulation/src/wallet_manager.rs: Stubbed consume() and settle_rjoules() on WalletBudgetPort — these were API-key encumbrance operations from the deleted hkask-wallet crate; regulation tracks per-agent gas balances, not per-key encumbrances. - kask/crates/hkask-regulation/src/wallet_gas_calibrator.rs: Fixed test to use crate::agent_wallet_store::WalletStore instead of hkask_storage::WalletStore. - kask/crates/hkask-regulation/Cargo.toml: Added tokio macros feature to dev-dependencies for #[tokio::test]. - kask/crates/kask_bridge/Cargo.toml: Added futures dependency (needed by context_injector.rs for futures::executor::block_on). - kask/crates/kask_bridge/src/context_injector.rs: Fixed futures_util::executor to futures::executor (futures-util doesn't include executor module). Release Notes: - N/A
0arm
pushed a commit
to 0arm/zed
that referenced
this pull request
Jul 26, 2026
# Objective Fix `spawn_agent` calls that provide an empty or whitespace-only `session_id`. Currently, an empty string is deserialized as a real session id, so the tool attempts to resume a session with an empty id instead of starting a new subagent session. This can happen when callers serialize an optional `session_id` field as `""`. Related: Refs zed-industries#55987. This addresses one concrete session-id failure mode described there, but that issue also covers broader OpenAI-compatible provider/subagent reliability concerns. ## Solution - Add custom deserialization for `SpawnAgentToolInput.session_id`. - Treat omitted, `null`, empty, and whitespace-only values as `None`. - Preserve existing behavior for non-empty `session_id` values, so follow-up calls still resume an existing subagent session. - Clarify the field docs. - Add a regression test covering omitted, `null`, empty, whitespace-only, and non-empty values. ## Testing Tested locally on macOS: - `RUSTUP_TOOLCHAIN=1.95.0 cargo fmt --manifest-path zed/Cargo.toml --package agent --check` - `RUSTUP_TOOLCHAIN=1.95.0 cargo test --manifest-path zed/Cargo.toml -p agent -p gpui_macos --features gpui_macos/runtime_shaders deserializes_blank_session_id_as_absent` - `RUSTUP_TOOLCHAIN=1.95.0 cargo build --manifest-path zed/Cargo.toml -p zed -p gpui_platform --features gpui_platform/runtime_shaders` - `RUSTUP_TOOLCHAIN=1.95.0 cargo clippy --manifest-path zed/Cargo.toml -p agent -p gpui_macos --features gpui_macos/runtime_shaders --tests -- -D warnings` The local build uses runtime shaders because this machine does not have the full Xcode Metal CLI toolchain available. CI should cover the standard build matrix. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed `spawn_agent` handling so blank `session_id` values are treated as absent and start a new subagent session. --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de> Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
# Objective Fix `spawn_agent` calls that provide an empty or whitespace-only `session_id`. Currently, an empty string is deserialized as a real session id, so the tool attempts to resume a session with an empty id instead of starting a new subagent session. This can happen when callers serialize an optional `session_id` field as `""`. Related: Refs zed-industries#55987. This addresses one concrete session-id failure mode described there, but that issue also covers broader OpenAI-compatible provider/subagent reliability concerns. ## Solution - Add custom deserialization for `SpawnAgentToolInput.session_id`. - Treat omitted, `null`, empty, and whitespace-only values as `None`. - Preserve existing behavior for non-empty `session_id` values, so follow-up calls still resume an existing subagent session. - Clarify the field docs. - Add a regression test covering omitted, `null`, empty, whitespace-only, and non-empty values. ## Testing Tested locally on macOS: - `RUSTUP_TOOLCHAIN=1.95.0 cargo fmt --manifest-path zed/Cargo.toml --package agent --check` - `RUSTUP_TOOLCHAIN=1.95.0 cargo test --manifest-path zed/Cargo.toml -p agent -p gpui_macos --features gpui_macos/runtime_shaders deserializes_blank_session_id_as_absent` - `RUSTUP_TOOLCHAIN=1.95.0 cargo build --manifest-path zed/Cargo.toml -p zed -p gpui_platform --features gpui_platform/runtime_shaders` - `RUSTUP_TOOLCHAIN=1.95.0 cargo clippy --manifest-path zed/Cargo.toml -p agent -p gpui_macos --features gpui_macos/runtime_shaders --tests -- -D warnings` The local build uses runtime shaders because this machine does not have the full Xcode Metal CLI toolchain available. CI should cover the standard build matrix. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed `spawn_agent` handling so blank `session_id` values are treated as absent and start a new subagent session. --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de> Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
5 tasks
playdohface
pushed a commit
to playdohface/zed
that referenced
this pull request
Aug 29, 2026
# Objective Fix `spawn_agent` calls that provide an empty or whitespace-only `session_id`. Currently, an empty string is deserialized as a real session id, so the tool attempts to resume a session with an empty id instead of starting a new subagent session. This can happen when callers serialize an optional `session_id` field as `""`. Related: Refs zed-industries#55987. This addresses one concrete session-id failure mode described there, but that issue also covers broader OpenAI-compatible provider/subagent reliability concerns. ## Solution - Add custom deserialization for `SpawnAgentToolInput.session_id`. - Treat omitted, `null`, empty, and whitespace-only values as `None`. - Preserve existing behavior for non-empty `session_id` values, so follow-up calls still resume an existing subagent session. - Clarify the field docs. - Add a regression test covering omitted, `null`, empty, whitespace-only, and non-empty values. ## Testing Tested locally on macOS: - `RUSTUP_TOOLCHAIN=1.95.0 cargo fmt --manifest-path zed/Cargo.toml --package agent --check` - `RUSTUP_TOOLCHAIN=1.95.0 cargo test --manifest-path zed/Cargo.toml -p agent -p gpui_macos --features gpui_macos/runtime_shaders deserializes_blank_session_id_as_absent` - `RUSTUP_TOOLCHAIN=1.95.0 cargo build --manifest-path zed/Cargo.toml -p zed -p gpui_platform --features gpui_platform/runtime_shaders` - `RUSTUP_TOOLCHAIN=1.95.0 cargo clippy --manifest-path zed/Cargo.toml -p agent -p gpui_macos --features gpui_macos/runtime_shaders --tests -- -D warnings` The local build uses runtime shaders because this machine does not have the full Xcode Metal CLI toolchain available. CI should cover the standard build matrix. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed `spawn_agent` handling so blank `session_id` values are treated as absent and start a new subagent session. --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de> Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fix
spawn_agentcalls that provide an empty or whitespace-onlysession_id.Currently, an empty string is deserialized as a real session id, so the tool attempts to resume a session with an empty id instead of starting a new subagent session. This can happen when callers serialize an optional
session_idfield as"".Related: Refs #55987. This addresses one concrete session-id failure mode described there, but that issue also covers broader OpenAI-compatible provider/subagent reliability concerns.
Solution
SpawnAgentToolInput.session_id.null, empty, and whitespace-only values asNone.session_idvalues, so follow-up calls still resume an existing subagent session.null, empty, whitespace-only, and non-empty values.Testing
Tested locally on macOS:
RUSTUP_TOOLCHAIN=1.95.0 cargo fmt --manifest-path zed/Cargo.toml --package agent --checkRUSTUP_TOOLCHAIN=1.95.0 cargo test --manifest-path zed/Cargo.toml -p agent -p gpui_macos --features gpui_macos/runtime_shaders deserializes_blank_session_id_as_absentRUSTUP_TOOLCHAIN=1.95.0 cargo build --manifest-path zed/Cargo.toml -p zed -p gpui_platform --features gpui_platform/runtime_shadersRUSTUP_TOOLCHAIN=1.95.0 cargo clippy --manifest-path zed/Cargo.toml -p agent -p gpui_macos --features gpui_macos/runtime_shaders --tests -- -D warningsThe local build uses runtime shaders because this machine does not have the full Xcode Metal CLI toolchain available. CI should cover the standard build matrix.
Self-Review Checklist:
Release Notes:
spawn_agenthandling so blanksession_idvalues are treated as absent and start a new subagent session.