Skip to content

[Agent Chat feedback] - Step 5: Attach the chat's messages to its feedback reports - #3617

Closed
zeroliu wants to merge 1 commit into
masterfrom
zeroliu/chat-report-transcript
Closed

zeroliu wants to merge 1 commit into
masterfrom
zeroliu/chat-report-transcript

Conversation

@zeroliu

@zeroliu zeroliu commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Relates to Brevilabs/obsidian-copilot-private#672

Why

A report started from the feedback card's Review & report is about that conversation. Today the bundle carries a screenshot of the window, which shows only the part of the chat on screen, plus logs. The Agent Mode activity log (on by default) holds the conversation only as raw protocol frames, with replies split into streamed chunks, and the bundle keeps only its tail, so early turns of a long chat are cut. When a user reports "it replied in Swedish", we need the turn where that happened, not just the last screenful.

What

Before: Review & report in a 40-message chat bundles a screenshot of the window showing the last few messages, the Copilot log and, when enabled, the activity log.

After: The same report also offers This chat's messages ("includes any note text shared in the chat"), ticked by default. When kept, the zip gains chat-transcript.md, the whole conversation in the same format as a saved chat note, cleaned by the same redaction pass as every log.

Settings → Report an issue has no chat behind it and does not offer the item. Unticking it leaves the transcript out entirely.

Non goal

  • Sending anything before the user presses Upload & open issue.
  • Attaching images from the chat; the transcript is text only.
  • Changing what the activity log or Copilot log collect.
  • Feedback cards in legacy Copilot Chat.
  • A Report error entry in the chat's More menu.

Screenshot

No screenshot yet for the feedback card path; the dialog's new This chat's messages item is covered by the ReportIssueFlow story.

Risk

High

Criterion Status Reason
No behavior change, or a cosmetic/copy/docs/config change visible where it renders, or deterministic tests cover the changed behavior ✅ ReportIssueModal tests cover offering the item only from a chat, packing chat-transcript.md into a real zip, and its place in log order; formatAgentChatTranscript and AgentChatMessages tests cover the transcript text and the feedback card passing it
A defect would fail CI or be obvious on first use ✅ The zip test reads the packed file back
A revert fully restores prior state, including persisted data ✅ Nothing is persisted; saved chat notes use the same formatter unchanged
No auth, permissions, secrets, or input-handling surface changes ❌ Adds user-authored chat text, which can quote note contents, to an uploadable bundle, ticked by default
No public API, plugin API, message, or on-disk contract changes ✅ The bundle gains an optional file; saved chat notes are byte-identical
No core-path concurrency, async-lifecycle, or state-machine changes ✅ The transcript is a string captured when the dialog opens
No hot-path behavior lacks deterministic coverage ✅ Every changed branch has a test
No new dependency ✅ Dependency manifests are unchanged
Human-only behavior stays in one feature area and surfaces quickly ✅ Visible on the dialog's attachment list and review page

Review: read buildSources and prepare in src/agentMode/ui/ReportIssueModal.tsx, the feedback card's handler in src/agentMode/ui/AgentChatMessages.tsx, and formatAgentChatTranscript in src/agentMode/session/AgentChatPersistenceManager.ts, then run Verification steps 2-5, including the redaction check in step 5.

Verification

  1. Install this build in a test vault with Agent Chat set up.
  2. In an Agent Chat with a few messages, tell the agent it got something wrong until the Report this to the Copilot team? card appears, then press Review & report. This chat's messages is listed and ticked. Press Prepare report: the review page lists chat-transcript.md. Show zip and open it; the file holds the whole conversation as **user**: / **ai**: blocks with timestamps. Press Cancel.
  3. Repeat with This chat's messages unticked; chat-transcript.md is absent from the review page.
  4. Open Settings → Advanced → Debugging & support → Report an issue; This chat's messages is not offered.
  5. In a chat, send a message containing a fake key such as sk-proj-abcdefghijklmnopqrstuvwxyz0123456789, then get the feedback card as in step 2, press Review & report, prepare the report, and open chat-transcript.md from Show zip. The key is replaced by a visible redaction marker. Press Cancel.

@zeroliu

zeroliu commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
obsidian-copilot-docs Ignored Ignored Oct 15, 2026 5:15pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T19:28:41.569385Z a178cde Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a178cde031

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +73 to +76
const body =
m.message.length === 0 && m.fanout
? serializeFanoutComposite(m.fanout, (id) => id)
: m.message;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include attached context in the reported transcript

When a user reports a response produced from selected note text, a web selection, or an image, that input is stored in message.context/message.content and sent by buildPromptBlocks, while this formatter serializes only m.message. The resulting chat-transcript.md therefore omits the contextual input that triggered the problem, despite the source description promising that shared note text is included; serialize the relevant context/content or retain the effective sent prompt for reporting.

Useful? React with 👍 / 👎.

Comment on lines +304 to +309
if (selected.has("chatTranscript")) {
logs.push({
id: "chatTranscript",
name: CHAT_TRANSCRIPT_NAME,
text: this.params.chatTranscript,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve room for the diagnostic logs after the transcript

When a long-running chat's transcript is larger than the bundle room left after the screenshot and Copilot log, buildReportBundle truncates this source to consume essentially all remaining bytes because sources are admitted in request order. Since the unbounded transcript is placed before the OpenCode and activity logs, those later sources are then dropped even though the nearby ordering policy exists specifically to prevent one large source from starving the others; put the bounded diagnostic logs first or reserve capacity for subsequent sources.

Useful? React with 👍 / 👎.

defaultChecked: true,
}
);
if (this.params.chatTranscript != null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Record the issue provenance for the new transcript branch

This newly added conditional behavior has no nearby explanation containing the originating GitHub issue URL, and its corresponding buildSources() test description also omits that URL. Add the issue-linked why comment and include the same full URL in the it(...) description so this edge path retains its required provenance.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

Comment thread src/agentMode/ui/AgentHome.tsx Outdated
origin: rootEl ?? undefined,
activeBackend: evidence?.backendId ?? settings.agentMode.activeBackend,
initialNote: evidence ? formatChatReportNote(evidence) : undefined,
chatTranscript: formatAgentChatTranscript(messages),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Cover the More Actions transcript handoff

The manual More Actions → Report error path is changed here, but no test renders AgentHome and verifies that the active chat's transcript reaches openReportIssueModal; the existing controls test stops after invoking a supplied callback, while the new AgentChatMessages assertion covers only the separate feedback-card path. Consequently this line can regress or be removed while all added tests remain green, so cover the observable manual-report flow with the active session's messages.

AGENTS.md reference: AGENTS.md:L29-L29

Useful? React with 👍 / 👎.

@zeroliu
zeroliu force-pushed the zeroliu/chat-report-transcript branch from a178cde to fa441a8 Compare October 14, 2026 21:50
@zeroliu
zeroliu force-pushed the zeroliu/chat-report-error branch 2 times, most recently from 46c1833 to f64e6d3 Compare October 14, 2026 22:11
@zeroliu
zeroliu force-pushed the zeroliu/chat-report-transcript branch from fa441a8 to 51f7fe4 Compare October 14, 2026 22:11
@zeroliu
zeroliu force-pushed the zeroliu/chat-report-error branch from f64e6d3 to 7c2c3bc Compare October 15, 2026 04:50
@zeroliu
zeroliu force-pushed the zeroliu/chat-report-transcript branch from 51f7fe4 to 4652975 Compare October 15, 2026 04:50
@zeroliu
zeroliu added this pull request to stack #3624 October 15, 2026 16:42
@zeroliu
zeroliu force-pushed the zeroliu/chat-report-error branch from 7c2c3bc to 846cace Compare October 15, 2026 16:44
@zeroliu
zeroliu force-pushed the zeroliu/chat-report-transcript branch from 4652975 to ede8d19 Compare October 15, 2026 16:44
The feedback card's Review & report now offers This chat's messages as a
ticked attachment, written in the saved chat note's format and cleaned
like every log. Settings' Report an issue has no chat and does not offer it.

Relates to Brevilabs/obsidian-copilot-private#672

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zeroliu
zeroliu force-pushed the zeroliu/chat-report-transcript branch from ede8d19 to 96f1b2d Compare October 15, 2026 17:15
@zeroliu
zeroliu removed this pull request from stack #3624 October 15, 2026 17:15
@zeroliu
zeroliu changed the base branch from zeroliu/chat-report-error to master October 15, 2026 17:15
@zeroliu zeroliu changed the title [Agent Chat feedback] - Step 6: Attach the chat's messages to its reports [Agent Chat feedback] - Step 5: Attach the chat's messages to its feedback reports Oct 15, 2026
@zeroliu

zeroliu commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

Dropped: the chat's messages stay out of reports; #3616 keeps Report error without them.

@zeroliu zeroliu closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant