fix(messages): keep UI-only notices out of the model payload - #899
Open
addyCooks wants to merge 1 commit into
Open
fix(messages): keep UI-only notices out of the model payload#899addyCooks wants to merge 1 commit into
addyCooks wants to merge 1 commit into
Conversation
Cancellation notices, inline error banners, the non-interactive tool-approval notice, and the VS Code replies to built-in slash commands (/help, /copy, /model, unrecognized commands) were pushed into conversation history as assistant messages. They sit in the same Message[] that becomes the provider payload, so the next request handed the model harness-authored markdown as its own past output — and because sessions persist Message[] verbatim, a resumed session replayed it into context too. The built-in command replies never involved the model at all, so both halves of that exchange are marked, not just the reply. Mark those notices displayOnly and filter them in convertToModelMessages, the single point where history becomes the provider payload. They still render in chat and still replay with session history. Closes Nano-Collective#893.
addyCooks
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
August 18, 2026 08:26
Contributor
Author
|
@will-lamerton chat-panel.js reads globalThis.NanocoderMentionUtils, which media/mention-utils.js defines. The webview loads both, but chat-panel-harness.ts only ran chat-panel.js, so createPanel() throws on the destructure and takes out all 28 chat-panel tests. The harness didn't get updated when the mention helpers were split into their own script in #842. One-line fix in the harness PR is up: #900. |
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.
Description
Cancellation notices, inline error banners, the non-interactive tool-approval notice, and the
VS Code replies to built-in slash commands (
/help,/copy,/model, unrecognized commands)were pushed into conversation history as
assistantmessages. They sit in the sameMessage[]that becomes the provider payload, so the next request handed the model harness-authored
markdown as its own past output and because sessions persist
Message[]verbatim, a resumedsession replayed it into context too. The built-in command replies never involved the model at
all, so both halves of that exchange are marked, not just the reply.
Mark those notices
displayOnlyand filter them inconvertToModelMessages, the single pointwhere history becomes the provider payload. They still render in chat and still replay with
session history.
Deliberately left alone:
truncateToolResult's elision marker (... [Output truncated: N characters total …] ...) harness-authored, but it lives inside a tool result, the correct channel for telling themodel its output was elided. Removing it would make truncation silent.
usermessages (auto-nudges, auto-diagnostics,[Active file: …]) and synthetictoolresults (cancellation placeholders, unknown-tool errors). These are the legitimate waya harness addresses a model, not text passed off as the model's own output.
cleanedContentandprepareStepwere audited and are already purely subtractive they strip tool-call syntax and empty messages, never add text.Closes #893.
Type of Change
Changeset
pnpm changeset) describing this change for the changelogTesting
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist
Assignment: #893 currently has no assignee — worth asking a maintainer to assign it before
merge.
Logging: no new logging. The change adds no new failure path; the three notice sites keep
their existing
logger.errorcalls, and the converter filter cannot fail.Breaking changes: none.
displayOnlyis an optional field onMessage; every existingmessage and every persisted session omits it and behaves exactly as before.