Skip to content

fix(openai): recover final response tool arguments - #3825

Merged
Sayt-0 merged 2 commits into
mainfrom
fix/copilot-responses-tool-arguments
Jul 24, 2026
Merged

Sayt-0 merged 2 commits into
mainfrom
fix/copilot-responses-tool-arguments

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • recover Responses API function arguments when providers omit response.function_call_arguments.delta
  • use response.function_call_arguments.done and the completed output-item snapshot as non-duplicating fallbacks
  • buffer final arguments received before response.output_item.added and ignore stale late deltas
  • add regression coverage for shell/read-file argument shapes, interleaved calls, reordered events, and duplicate prevention

Issue expectations

Expectation Implementation
shell receives its cmd argument with GitHub Copilot OpenAI models Final arguments are emitted from response.function_call_arguments.done when no deltas were delivered
read_file receives its path argument The same provider-level recovery applies to every Responses API function tool
No tool-call doom loop Empty arguments are no longer forwarded, and final snapshots are emitted only once
Preserve normal Responses API streaming Existing argument deltas remain unchanged; final events only provide fallbacks and terminate stale deltas

Validation

  • deterministic regression reproduced before the fix with empty arguments, then passed after the fix
  • live GitHub Copilot checks passed with gpt-5.5 and gpt-5.6 variants for shell and read_file
  • go test ./pkg/model/provider/openai -run 'TestResponseStream_' -count=20
  • go test -race ./pkg/model/provider/openai
  • task test
  • task lint
  • task build

Residual uncertainty

GitHub Copilot may expose undocumented stream orderings beyond those observed. The implementation covers the standard ordering, missing argument deltas, final snapshots, early final events, interleaved calls, and stale late deltas.

Fixes #3818

@Sayt-0
Sayt-0 requested a review from a team as a code owner July 24, 2026 09:21
@aheritier aheritier added area/providers For features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.) area/providers/openai For features/issues/fixes related to the usage of OpenAI models kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Jul 24, 2026
@Sayt-0
Sayt-0 enabled auto-merge July 24, 2026 09:39
@Sayt-0
Sayt-0 enabled auto-merge July 24, 2026 09:41
@Sayt-0
Sayt-0 merged commit 0747444 into main Jul 24, 2026
14 checks passed
@Sayt-0
Sayt-0 deleted the fix/copilot-responses-tool-arguments branch July 24, 2026 09:41
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
docker-agent 1.116.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 sandbox authentication improvements, compaction-model context visibility in the TUI, MCP lifecycle enforcement, and a range of bug fixes across the TUI, CLI, and OpenAI integration.

## What's New

- Adds `sbx-login` injection for gateway authentication in sandbox environments, replacing the previous file-based token-forwarding mechanism
- Defaults sandbox creation to the `docker/docker-agent-sbx-templates:latest` template
- Creates sandboxes under the canonical `docker-agent` name
- Makes `oauth clientId` optional for remote MCP toolsets, supporting Dynamic Client Registration and interactive credential flows
- Surfaces the compaction-model context-limit cap explicitly in the `/context` dialog and sidebar, so users can see when a dedicated compaction model is imposing a smaller context window than the primary model
- Adds segment-aware click detection on the sidebar Token Usage reading: clicking the token count/percentage opens `/context`, clicking the cost/`⚠ capped` area opens `/cost`; the "Token Usage" title is no longer clickable
- Enforces `lifecycle.call_timeout` for MCP tool calls, which was previously parsed but never acted on
- Exposes spawned TUI tabs (opened with ctrl+t) on the `--listen` control plane so control-plane clients can observe all active sessions
- Adds GitHub Copilot to `docker agent setup` and `doctor`, recognizing both `GITHUB_TOKEN` and `GH_TOKEN`

## Bug Fixes

- Fixes copy buttons rendering in contexts where they were never wired up for hit-testing (reasoning blocks, elicitation dialogs, lean TUI, shell output, welcome messages)
- Fixes the "copied" flash background on user-message copy labels, which previously rendered with a transparent background
- Fixes mouse hit-testing falling out of sync when layout shifts without a terminal resize (e.g., after loading a past session with `/session`)
- Fixes an infinite loop in `backgroundAt` when encountering invalid UTF-8 bytes
- Fixes capability handlers (OAuth elicitation, etc.) not being forwarded to inner toolsets when `code_mode_tools: true` is set
- Fixes data races in deferred tools and the BM25 RAG strategy, and prevents a TUI editor panic
- Fixes wrapped URLs losing their clickability in tool output
- Fixes the `⚠ capped` marker on the sidebar opening `/cost` instead of `/context`
- Fixes `docker agent debug` not appearing in the root help output
- Fixes `docker agent setup` provider path labels to clarify built-in cloud providers vs. custom OpenAI-compatible endpoints
- Fixes OpenAI Responses API function arguments not being recovered when providers omit `response.function_call_arguments.delta`

## Technical Changes

- Refactors sandbox integration to assume the modern CLI surface shared by both backends
- Removes all references to the discontinued `agentcatalog` Docker Hub namespace, replacing examples with neutral `myorg/agent` placeholders
- Freezes config schema v14 and advances `latest` to v15
- Refactors board internals: deduplicates column lookup with a `columnIndexLocked` helper, deduplicates stored-project access with a `projectsLocked` helper, and consolidates per-card controller state into a single `cardState` map
---

## What's Changed
* fix(tui): never render dead code-block copy buttons by @dgageot in docker/docker-agent#3789
* docs: update CHANGELOG.md for v1.115.0 by @docker-read-write[bot] in docker/docker-agent#3790
* sandbox: rely on sbx-login injection for gateway auth, modern sandbox CLI surface by @dgageot in docker/docker-agent#3791
* docs: update slash command and permission pattern docs for recent changes by @aheritier in docker/docker-agent#3794
* feat(config): make oauth clientId optional for remote MCP toolsets by @dgageot in docker/docker-agent#3796
* fix(tui): keep copy label background under "copied" flash by @dgageot in docker/docker-agent#3797
* fix(tui): guard backgroundAt against infinite loop on invalid UTF-8 by @dgageot in docker/docker-agent#3799
* fix(tui): keep mouse hit-testing in sync when the layout shifts without a resize by @dgageot in docker/docker-agent#3798
* chore: remove every trace of the discontinued agent catalog by @dgageot in docker/docker-agent#3804
* chore: bump direct Go dependencies by @dgageot in docker/docker-agent#3801
* fix(cli): add GitHub Copilot to setup and doctor by @stkevintan in docker/docker-agent#3793
* feat(config): freeze config v14 and start v15 as latest by @dgageot in docker/docker-agent#3807
* docs: auto-update for merged PRs (2026-07-23) by @aheritier in docker/docker-agent#3812
* docs: improve Ollama and local models discoverability by @aheritier in docker/docker-agent#3810
* fix(codemode): forward capability handlers to inner toolsets by @aheritier in docker/docker-agent#3809
* docs: auto-update for merged PRs (2026-07-24) by @aheritier in docker/docker-agent#3815
* feat(tui): open /context or /cost from the sidebar token-usage reading by @aheritier in docker/docker-agent#3813
* feat(tui): surface compaction-model context-limit cap in the TUI by @aheritier in docker/docker-agent#3811
* chore: bump direct Go dependencies by @dgageot in docker/docker-agent#3816
* refactor(board): simplify app and controller internals by @dgageot in docker/docker-agent#3817
* feat: enforce lifecycle.call_timeout for MCP tool calls by @jedp-docker in docker/docker-agent#3814
* feat(run): expose spawned TUI tabs on the --listen control plane by @dgageot in docker/docker-agent#3819
* fix: resolve data races in deferred tools and BM25 strategy, prevent TUI editor panic by @Piyush0049 in docker/docker-agent#3822
* fix(tui): keep wrapped URLs clickable by @Sayt-0 in docker/docker-agent#3823
* fix(setup): clarify model provider paths by @Sayt-0 in docker/docker-agent#3824
* fix(openai): recover final response tool arguments by @Sayt-0 in docker/docker-agent#3825
* fix(tui): open /context (not /cost) when clicking the ⚠ capped marker by @aheritier in docker/docker-agent#3826
* fix(cli): show debug command in help by @Sayt-0 in docker/docker-agent#3827

## New Contributors
* @stkevintan made their first contribution in docker/docker-agent#3793

**Full Changelog**: docker/docker-agent@v1.115.0...v1.116.0
</pre>
  <p>View the full release notes at <a href="https://github.com/docker/docker-agent/releases/tag/v1.116.0">https://github.com/docker/docker-agent/releases/tag/v1.116.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!15049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/providers/openai For features/issues/fixes related to the usage of OpenAI models area/providers For features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.) kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

builtin filesystem and shell tools not working with github-copilot OpenAI models

3 participants