Skip to content

fix text editor view broken#7167

Merged
lifeizhou-ap merged 2 commits intomainfrom
dkatz/embedded-fix
Feb 12, 2026
Merged

fix text editor view broken#7167
lifeizhou-ap merged 2 commits intomainfrom
dkatz/embedded-fix

Conversation

@katzdave
Copy link
Collaborator

Summary

text_editor_view was the only tool in the codebase using Content::embedded_text() (a RawContent::Resource type) to return file content to the model, but most providers only extract RawContent::Text from tool results — so the content was silently dropped. The fix changes it to use Content::text() like every other tool function, which all providers handle correctly.

fixes: #7164

Type of Change

  • Feature
  • [ x ] Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

Copilot AI review requested due to automatic review settings February 11, 2026 22:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes text_editor_view returning empty content to the model by aligning its tool result payload with what providers reliably parse.

Changes:

  • Replace Content::embedded_text(uri, content) with Content::text(...) for the assistant-audience tool result.
  • Remove url::Url usage and associated file-path-to-URI conversion.
  • Send the formatted (range/line-number) view output to both assistant and user audiences.

Comment on lines +683 to 686
Content::text(formatted.clone()).with_audience(vec![Role::Assistant]),
Content::text(formatted)
.with_audience(vec![Role::User])
.with_priority(0.0),
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change fixes model-facing output by switching the assistant-audience payload to Content::text, but there’s no regression test asserting that text_editor view returns non-empty assistant-audience text content (current tests only validate the user-audience output); consider adding a test in crates/goose-mcp/src/developer/rmcp_developer.rs that locates the Role::Assistant item and asserts it contains the viewed lines.

Copilot generated this review using guidance from repository custom instructions.
@lifeizhou-ap lifeizhou-ap added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit ac0cedd Feb 12, 2026
19 checks passed
@lifeizhou-ap lifeizhou-ap deleted the dkatz/embedded-fix branch February 12, 2026 07:21
lifeizhou-ap added a commit that referenced this pull request Feb 12, 2026
* main:
  fix text editor view broken (#7167)
  docs: White label guide (#6857)
  Add PATH detection back to developer extension (#7161)
  docs: pin version in ci/cd (#7168)
  Desktop: - No Custom Headers field for custom OpenAI-compatible providers  (#6681)
  feat: edit model and extensions of a recipe from GUI (#6804)
  feat: MCP support for agentic CLI providers (#6972)
jh-block added a commit that referenced this pull request Feb 12, 2026
* origin/main: (33 commits)
  fix: replace panic with proper error handling in get_tokenizer (#7175)
  Lifei/smoke test for developer (#7174)
  fix text editor view broken (#7167)
  docs: White label guide (#6857)
  Add PATH detection back to developer extension (#7161)
  docs: pin version in ci/cd (#7168)
  Desktop: - No Custom Headers field for custom OpenAI-compatible providers  (#6681)
  feat: edit model and extensions of a recipe from GUI (#6804)
  feat: MCP support for agentic CLI providers (#6972)
  docs: keyring fallback to secrets.yaml (#7165)
  feat: load provider/model specified inside the recipe config (#6884)
  fix ask-ai bot hitting tool call limits (#7162)
  fix flatpak icon (#7154)
  [docs] Skills Marketplace UI Improvements (#7158)
  More no-window flags (#7122)
  feat: Allow overriding default bat themes using environment variables (#7140)
  Make the system prompt smaller (#6991)
  Pre release script (#7145)
  Spelling (#7137)
  feat(mcp): upgrade rmcp to 0.15.0 and advertise MCP Apps UI extension capability (#6927)
  ...
katzdave added a commit that referenced this pull request Feb 12, 2026
tlongwell-block added a commit that referenced this pull request Feb 12, 2026
…provenance

* origin/main: (68 commits)
  Upgraded npm packages for latest security updates (#7183)
  docs: reasoning effort levels for Codex provider (#6798)
  Fix speech local (#7181)
  chore: add .gooseignore to .gitignore (#6826)
  Improve error message logging from electron (#7130)
  chore(deps): bump jsonwebtoken from 9.3.1 to 10.3.0 (#6924)
  docs: standalone mcp apps and apps extension (#6791)
  workflow: auto-update cli-commands on release (#6755)
  feat(apps): Integrate AppRenderer from @mcp-ui/client SDK (#7013)
  fix(MCP): decode resource content (#7155)
  feat: reasoning_content in API for reasoning models (#6322)
  Fix/configure add provider custom headers (#7157)
  fix: handle keyring fallback as success (#7177)
  Update process-wrap to 9.0.3 (9.0.2 is yanked) (#7176)
  feat: support extra field in chatcompletion tool_calls for gemini openai compat (#6184)
  fix: replace panic with proper error handling in get_tokenizer (#7175)
  Lifei/smoke test for developer (#7174)
  fix text editor view broken (#7167)
  docs: White label guide (#6857)
  Add PATH detection back to developer extension (#7161)
  ...

# Conflicts:
#	.github/workflows/nightly.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

text editor view broken in main

2 participants