Add !attach support to interactive chat - #1603
Draft
simonw wants to merge 2 commits into
Draft
Conversation
Owner
Author
|
Doesn't feel quite right. It sends the attachment with an empty prompt as soon as you hit enter, so you don't get a chance to say what you want to do with it: Related issue: if the URL is invalid it quits the whole chat session (idea here was what if you put a prompt after the attach, but that doesn't make sense because a filename could have spaces in it): |
Standalone !attach commands now accumulate attachments without sending an empty prompt. The next real message consumes them once, and invalid attachments report an error without terminating the interactive session or losing pending state.
Owner
Author
|
Fixed in 8040274.
The regression test covers queueing multiple files, continuing after an invalid attachment, attaching them to the next prompt, and not leaking them into the following turn. |
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.
!attach url-or-pathin chat.Codex PR
## Summary!attach <url-or-path>to interactive chat sessions!multiand!fragmentllm chatandllm openai endpoint --chatWhy
Interactive chat sessions had no command for attaching a file or URL to a later turn. This implements the same general feature proposed in #734, updated for the current shared chat loop and message logging architecture.
Validation
uv run pytest -q tests/test_chat.py tests/test_openai_endpoint.py— 37 passeduv run black --check llm/cli.py tests/test_chat.pyuv run ruff check llm/cli.py tests/test_chat.py