| … | … | @@ -4093,10 +4166,34 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) | |
| 4182 | + | { expectedText: snapshot.value.slice(trigger.rangeStart, replacementRangeEnd) }, | |
| 4183 | + | ); | |
| 4184 | + | if (applied) { | |
| 4185 | + | addComposerDraftEnvironmentContexts(composerDraftTarget, [record], { | |
🟠 High chat/ChatComposer.tsx:4185
Selecting an environment mention while answering a pending question adds its record to the ordinary thread draft, so a later ordinary send includes that machine even though the thread prompt does not reference it. applyPromptReplacement routes the text to the question answer, but this branch adds the record to composerDraftTarget, and the question path in onPromptChange does not reconcile it; disable this selection during questions or store and reconcile the context with the answer.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/web/src/components/chat/ChatComposer.tsx around line 4185: |
| 2 | |
| 3 | Selecting an environment mention while answering a pending question adds its record to the ordinary thread draft, so a later ordinary send includes that machine even though the thread prompt does not reference it. `applyPromptReplacement` routes the text to the question answer, but this branch adds the record to `composerDraftTarget`, and the question path in `onPromptChange` does not reconcile it; disable this selection during questions or store and reconcile the context with the answer. |
Still true after the earlier change, so fixed in 3666271a4f: while the composer answers an agent's question, the @ menu offers no machines and a pasted machine chip is dropped. An answer carries thread links only, so a machine record had nowhere correct to go.