Skip to content

Clarify that create_or_update_file content is plain text, not base64 - #2983

Merged
RossTarrant merged 1 commit into
github:mainfrom
ericsciple:clarify-create-or-update-file-content-encoding
Jul 31, 2026
Merged

Clarify that create_or_update_file content is plain text, not base64#2983
RossTarrant merged 1 commit into
github:mainfrom
ericsciple:clarify-create-or-update-file-content-encoding

Conversation

@ericsciple

Copy link
Copy Markdown
Member

Fixes the ambiguity reported in #2981.

content is passed to the API as plain text and this server base64-encodes it, but the description said only "Content of the file". The REST endpoint this wraps documents its content field as base64, so a model reading the tool description has a strong reason to encode the value itself. When it does, the server encodes again and the file is committed containing base64 text, with success reported at every layer.

The new description says how the value should end up on disk rather than only what not to do, so a file whose contents are legitimately base64 stays unambiguous. It also names the encoding step, so the conflict with the REST API docs is resolved rather than merely overridden.

Content of the file, exactly as it should appear once written. Do not base64-encode it;
this server does that before calling the REST API.

Scoped to create_or_update_file only. push_files and the gist tools pass content through without encoding, so this bug does not apply to them (see the follow-up comment on #2981).

Regenerated toolsnaps and README per CONTRIBUTING. go test ./... and script/lint both pass.

The content parameter is passed to the API as plain text and the server
base64-encodes it, but the description said only "Content of the file".
The REST endpoint this wraps documents its own content field as base64,
so a model reading the tool description has a strong reason to encode the
content itself. When it does, the server encodes again and the file is
committed containing base64 text. Every layer reports success.

Describe the value by how it should end up on disk rather than by what
not to do, so a file whose contents are legitimately base64 is still
unambiguous, and name the encoding step so the conflict with the REST
API docs is resolved rather than merely overridden.
@ericsciple
ericsciple marked this pull request as ready for review July 30, 2026 23:17
@ericsciple
ericsciple requested a review from a team as a code owner July 30, 2026 23:17
Copilot AI review requested due to automatic review settings July 30, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Clarifies that create_or_update_file accepts content exactly as it should appear on disk, preventing accidental double base64 encoding.

Changes:

  • Clarified the content parameter description.
  • Regenerated documentation and schema snapshot.
Show a summary per file
File Description
README.md Updates generated tool documentation.
pkg/github/repositories.go Clarifies the content input contract.
pkg/github/__toolsnaps__/create_or_update_file.snap Updates the tool schema snapshot.

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@RossTarrant
RossTarrant merged commit 3778a41 into github:main Jul 31, 2026
13 checks passed
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.

3 participants