Repository navigation
fix(runtime): reliable, correlation-safe, non-blocking elicitation delivery (#3584) - #3587
Merged
Merged
Conversation
aheritier
commented
Jul 11, 2026
|
|
||
| For advanced use (custom elicitation, raw event inspection), call `chat.Runtime()` to access the underlying `runtime.Runtime` directly. | ||
|
|
||
| > [!WARNING] |
| b.ch <- ev | ||
| return nil | ||
| select { | ||
| case b.ch <- ev: |
| // means the response will reach the caller, never a discarded one. | ||
| func (r *LocalRuntime) ResumeElicitation(ctx context.Context, action tools.ElicitationAction, content map[string]any, elicitationID ...string) error { | ||
| id := firstElicitationID(elicitationID) | ||
| slog.DebugContext(ctx, "Resuming runtime with elicitation response", "agent", r.currentAgentName(), "action", action, "elicitation_id", id) |
| ok = r.elicitationWaiters.resolveSingle(result) | ||
| } | ||
| if !ok { | ||
| slog.DebugContext(ctx, "No matching elicitation request in progress", "elicitation_id", id) |
| slog.DebugContext(ctx, "No matching elicitation request in progress", "elicitation_id", id) | ||
| return errNoSuchElicitation | ||
| } | ||
| slog.DebugContext(ctx, "Elicitation response sent successfully", "action", action) |
| func (r *RemoteRuntime) ResumeElicitation(ctx context.Context, action tools.ElicitationAction, content map[string]any) error { | ||
| slog.DebugContext(ctx, "Resuming remote runtime with elicitation response", "agent", r.currentAgent, "action", action, "session_id", r.sessionID) | ||
| func (r *RemoteRuntime) ResumeElicitation(ctx context.Context, action tools.ElicitationAction, content map[string]any, elicitationID ...string) error { | ||
| id := firstElicitationID(elicitationID) |
| slog.DebugContext(ctx, "Resuming remote runtime with elicitation response", "agent", r.currentAgent, "action", action, "session_id", r.sessionID) | ||
| func (r *RemoteRuntime) ResumeElicitation(ctx context.Context, action tools.ElicitationAction, content map[string]any, elicitationID ...string) error { | ||
| id := firstElicitationID(elicitationID) | ||
| slog.DebugContext(ctx, "Resuming remote runtime with elicitation response", "agent", r.currentAgent, "action", action, "session_id", r.sessionID, "elicitation_id", id) |
aheritier
force-pushed
the
fix/a6-elicitation-concurrency
branch
2 times, most recently
from
July 13, 2026 14:37
06d22e7 to
5db8299
Compare
aheritier
force-pushed
the
fix/a6-elicitation-concurrency
branch
from
July 13, 2026 14:40
5db8299 to
811d91d
Compare
aheritier
marked this pull request as ready for review
July 13, 2026 14:56
Collaborator
Author
|
/review |
Contributor
|
👋 Heads up: The |
dgageot
approved these changes
Jul 15, 2026
aheritier
added a commit
that referenced
this pull request
Jul 15, 2026
…ibility (#3584) Change NewElicitationDialog, NewURLElicitationDialog, NewOAuthAuthorizationDialog, and App.ResumeElicitation to take the new correlation-ID argument as a trailing variadic elicitationID ...string instead of a required positional string, following #3587's precedent for Runtime.ResumeElicitation. This restores source compatibility for external callers and fixes the compile break against 3-arg NewElicitationDialog call sites added on main (bebfc22). Existing call sites in this branch that pass a real elicitation ID are unchanged (still pass it as the variadic arg), so response correlation is preserved. NewOAuthAuthorizationDialog's parameter order also changes: appInstance now comes before the new variadic elicitationID, so the trailing ID stays last across all four signatures.
aheritier
added a commit
that referenced
this pull request
Jul 15, 2026
…ibility (#3584) Change NewElicitationDialog, NewURLElicitationDialog, NewOAuthAuthorizationDialog, and App.ResumeElicitation to take the new correlation-ID argument as a trailing variadic elicitationID ...string instead of a required positional string, following #3587's precedent for Runtime.ResumeElicitation. This restores source compatibility for external callers and fixes the compile break against 3-arg NewElicitationDialog call sites added on main (bebfc22). Existing call sites in this branch that pass a real elicitation ID are unchanged (still pass it as the variadic arg), so response correlation is preserved. NewOAuthAuthorizationDialog's parameter order also changes: appInstance now comes before the new variadic elicitationID, so the trailing ID stays last across all four signatures.
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
docker-agent 1.110.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>This release adds dynamic MCP HTTP headers, new shell safety policies, per-model custom pricing, and cache-stable dynamic prompts, along with fixes for elicitation delivery and session cost tracking. ## What's New - Adds dynamic MCP HTTP headers via a header factory, enabling context-aware HTTP header resolution instead of static headers fixed at startup - Adds a `safe-auto` safety policy for shell operations, providing a middle ground between prompting for every tool call and `--yolo` mode; safe calls beyond shell are auto-approved under this policy, with an opt-in `safer` mode available via `approve-safer` resume - Adds an optional `cost` block to model configuration, allowing explicit per-model token pricing for custom, locally-hosted, or uncatalogued models - Adds opt-in cache-stable dynamic prompts (`cache_stable_prompts` user setting), persisting frozen instruction snapshots and appending chronological updates when trusted context changes ## Bug Fixes - Fixes elicitation requests from concurrent background jobs being silently dropped and blocking the requesting handler indefinitely - Fixes session cost dropping after compaction (e.g., from $49 to $12) by keeping cost monotonic across compaction and preserving cost accounting across reload --- ## What's Changed * feat: implement dynamic MCP HTTP headers via header factory by @Piyush0049 in docker/docker-agent#3583 * fix(runtime): reliable, correlation-safe, non-blocking elicitation delivery (#3584) by @aheritier in docker/docker-agent#3587 * docs: update CHANGELOG.md for v1.109.0 by @docker-read-write[bot] in docker/docker-agent#3661 * Add opt-in cache-stable dynamic prompts by @rumpl in docker/docker-agent#3662 * fix(session): keep cost monotonic across compaction by @Sayt-0 in docker/docker-agent#3663 * feat(safer_shell): add safe-auto safety policy by @trungutt in docker/docker-agent#3647 * feat(config): declare explicit per-model token pricing with cost by @dgageot in docker/docker-agent#3664 **Full Changelog**: docker/docker-agent@v1.109.0...v1.110.0 </pre> <p>View the full release notes at <a href="https://github.com/docker/docker-agent/releases/tag/v1.110.0">https://github.com/docker/docker-agent/releases/tag/v1.110.0</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!14319
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.
Summary
Previously this PR was the full A6 implementation; it has been split into a reviewable stack and now scopes to the runtime core only. Fixes the heart of #3584 — elicitation requests raised from concurrent background jobs were silently dropped and the requesting handler blocked forever.
#3584 stack
What changed
OnElicitationRequestsink is called synchronously; the best-effort bridge send is ctx-bounded on a detached goroutine and can never block delivery or response processing.ctx.Done().ResumeElicitation's newelicitationIDis variadic (pre-Concurrent background-job elicitations are silently dropped — nothing displayed to the user #3584 callers still compile); additiveelicitation_idwire field; server pass-through wires it end-to-end.The
Runtimeinterface change and its repo-wide implementor/mock updates are one commit for Go compile atomicity.Testing
pkg/runtime/elicitation_concurrency_test.go: duplicate wire IDs, cancel-vs-resolve race (300-iter-race), wedged bridge, real-handler TOCTOU, exactly-once delivery, concurrent background-job routing.task dev+-race— green.Bottom of the remaining stack (targets
mainnow that #3618 is merged).