fix: preserve large pasted prompts as plain text#3062
Open
chindris-mihai-alexandru wants to merge 7 commits intotailcallhq:mainfrom
Open
fix: preserve large pasted prompts as plain text#3062chindris-mihai-alexandru wants to merge 7 commits intotailcallhq:mainfrom
chindris-mihai-alexandru wants to merge 7 commits intotailcallhq:mainfrom
Conversation
Add AdaL CLI by SylphAI as a new provider option in ForgeCode. AdaL is
registered as an OpenAI-compatible provider with api.sylph.ai endpoints,
enabling ForgeCode users to access AdaL's models via API key auth.
Changes:
- Add 'adal' entry to provider.json with OpenAI response type
- Add ProviderId::ADAL constant to forge_domain
- Wire up display_name ("AdaL"), FromStr, and built_in_providers()
- Add missing FromStr arms for vertex_ai_anthropic, bedrock, opencode_zen
- Add unit tests for ADAL display name, from_str, and built_in_providers
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
Add Modal as a new provider in ForgeCode, enabling access to Z.ai's
GLM-5 745B parameter model hosted on Modal's infrastructure. Modal
offers an OpenAI-compatible API endpoint with free GLM-5 access
until April 30th, 2026.
Changes:
- Add 'modal' entry to provider.json with GLM-5-FP8 model
- Add ProviderId::MODAL constant to forge_domain
- Wire up display_name ("Modal"), FromStr, and built_in_providers()
- Add unit tests for MODAL display name, from_str, and built_in_providers
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
Combines both provider branches to enable AdaL (SylphAI) and Modal (GLM-5) support. Co-Authored-By: ForgeCode <noreply@forgecode.dev>
# Conflicts: # crates/forge_domain/src/provider.rs # crates/forge_repo/src/provider/provider.json
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
There was a problem hiding this comment.
Pull request overview
This PR adjusts Forge’s bracketed-paste handling so large or multiline pastes remain plain text instead of having embedded absolute paths auto-wrapped into @[...] attachments, preventing confusing “binary file” attachment errors from incidental paths in prompts/logs.
Changes:
- Skip token-by-token absolute-path wrapping when the paste is multiline or exceeds a size threshold.
- Add regression tests covering multiline prompts and large single-line prompts that contain real absolute paths.
- Add
ACP_TRACKING.md(appears unrelated to the paste-wrapping fix described in the PR).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
crates/forge_main/src/zsh/paste.rs |
Adds guards to preserve large/multiline pastes as plain text and introduces regression tests. |
ACP_TRACKING.md |
Adds an ACP integration tracking checklist (not referenced by the PR’s summary/goal). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
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
Prevent large pasted prompts and multiline pastes from being auto-converted into
@[...]attachments, which avoids spurious binary-file errors when pasted text happens to contain absolute paths.Context
Forge currently auto-wraps pasted absolute paths so drag-and-drop file references become attachments immediately. That behavior works well for short path pastes, but it also catches paths embedded inside large prompts, logs, or snippets. When those paths point to executables such as
/usr/bin/env, Forge later tries to open them as attachments and surfacesBinary files are not supported/application/x-mach-binary, even though the user only pasted plain text.I could not find an existing upstream issue or PR for this exact behavior after searching the Forge repository and broader GitHub issue search.
Changes
Key Implementation Details
The new logic keeps whole-path detection intact, so direct file pastes like
/tmp/file.txtor quoted drag-and-drop paths still become attachments. Token-by-token path wrapping now only runs for smaller single-line pastes, which are much more likely to represent intentional path references than arbitrary prompt text.Use Cases
/usr/bin/envwithout Forge turning it into an attachmentTesting
cargo test -p forge_main cargo check cargo clippy -p forge_main --all-targets -- -D warningsLinks
fix/avoid-path-wrap-in-large-pastes174266e24