Skip to content

refactor(goose2): remove attachment preamble - #9052

Merged
alexhancock merged 2 commits into
mainfrom
alexhancock/goose-2-axe-attachment-preamble
May 6, 2026
Merged

refactor(goose2): remove attachment preamble#9052
alexhancock merged 2 commits into
mainfrom
alexhancock/goose-2-axe-attachment-preamble

Conversation

@alexhancock

@alexhancock alexhancock commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Remove the preamble for images, and make it so for files/dirs it just does the same thing goose1 desktop used to, which is to suffix an absolute path to the files and let the agent read it. This version has one improvement where it doesn't include it as plaintext and renders a nice bubble instead.

Testing

Existing tests + manual test in goose2 desktop

Related Issues

N/A

Screenshots/Demos (for UX changes)

Screenshot 2026-05-06 at 10 15 48 AM Screenshot 2026-05-06 at 10 40 19 AM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d16b9e79c3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +233 to +234
const acpPrompt =
promptWithPaths || (images?.length ? " " : promptWithPaths);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve non-empty prompt when attachments lack absolute paths

If a user sends only non-image attachments that have no path (the pathless browser-file case covered by tests) and no message text, appendAttachmentPaths(text.trim(), attachments) returns "" and acpPrompt stays empty. The earlier guard still allows this send because hasAttachments is true, so acpSendMessage receives an empty text block, which is the same class of payload this function already special-cases for image-only sends via " ". In practice this makes attachment-only submits fail for pathless files/directories instead of reaching the model.

Useful? React with 👍 / 👎.

@DOsinga DOsinga left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice improvement. the tests we are touching here are showing they are not very useful seeing that we need to change them for something not that related. I think we could drop them

@alexhancock
alexhancock force-pushed the alexhancock/goose-2-axe-attachment-preamble branch from bb226d5 to eec6c0c Compare May 6, 2026 17:01
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

const acpPrompt =
promptWithPaths || (images?.length ? " " : promptWithPaths);

P1 Badge Keep prompt non-empty for pathless attachment-only sends

When attachments are present but none have a usable path (the browser-file case) and the user sends no text, appendAttachmentPaths(text.trim(), attachments) returns "", so acpPrompt also becomes "" because there are no images to trigger the space fallback. The send guard still allows this path (hasAttachments is true), so acpSendMessage receives an empty text block and the backend rejects it. Fresh evidence in this commit: the updated pathless-file test only covers a non-empty user text case, so this empty-text path remains unhandled.


const joined = paths.join(" ");

P2 Badge Delimit appended attachment paths with an unambiguous format

Joining attachment paths with a single space makes path boundaries ambiguous whenever a path itself contains spaces (common on desktop OSes), so the model can receive a merged token stream that no longer cleanly identifies each file/directory path. This regression is introduced by replacing structured per-item formatting with paths.join(" "); use quoting or another explicit per-path delimiter to preserve exact path boundaries.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@alexhancock
alexhancock added this pull request to the merge queue May 6, 2026
Merged via the queue into main with commit 0ed8c66 May 6, 2026
26 checks passed
@alexhancock
alexhancock deleted the alexhancock/goose-2-axe-attachment-preamble branch May 6, 2026 17:48
lifeizhou-ap added a commit that referenced this pull request May 7, 2026
…-refactor

* origin/main:
  refactor: switch to official new rust-sdk for ACP (#9062)
  refactor(goose2): remove attachment preamble (#9052)
  Align CODEOWNERS with pull request review rules in GOVERNANCE.md (#9056)
  bring MAINTAINERS.md up to date (#9053)
  feat(acp): expose built-in skills through sources list acp calls (#9045)
  add provider-first onboarding (#9039)
  feat: ACP streamable http spec compliance (#9034)
  Skip automatic fix which crashes (#9036)
  fix(openai): accept null tool_call arguments in streaming chunks (#9035)

Signed-off-by: Lifei Zhou <lifei@squareup.com>

# Conflicts:
#	ui/goose2/src/features/chat/hooks/useChat.ts
shafqatevo pushed a commit to shafqatevo/goose that referenced this pull request Aug 7, 2026
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.

2 participants