Skip to content

[Agent Chat feedback] - Step 2: Open Report an issue with a drafted note - #3594

Open
zeroliu wants to merge 5 commits into
zeroliu/agent-feedback-mcpfrom
zeroliu/report-issue-prefill
Open

zeroliu wants to merge 5 commits into
zeroliu/agent-feedback-mcpfrom
zeroliu/report-issue-prefill

Conversation

@zeroliu

@zeroliu zeroliu commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Relates to Brevilabs/obsidian-copilot-private#672

Why

The feedback card in the next step sends the user to the existing Report an issue dialog with the agent's draft already written. Today that dialog can only be opened from Settings → Advanced → Report an issue: the settings tab builds it inline, and it always starts with an empty description, the OpenCode log unticked, and no way for the caller to learn that the upload landed.

Its screenshot is of the first Agent Chat pane only. An error shown anywhere else (a note, another dialog, a sidebar) never reaches the report, a report about chat B can carry a picture of chat A, and with no Agent Chat open there is no screenshot at all. Choosing the right pane would mean every caller telling the dialog where it was opened from.

What

Any Copilot surface can now open Report an issue, optionally with a drafted description, every attachment ticked, and a callback when the upload succeeds. The settings button opens it as it does today.

Opened with Before After
Nothing extra (Settings → Advanced → Report an issue) Empty description; OpenCode log unticked Unchanged
A drafted note Not possible The description starts with the draft and stays editable
Every attachment ticked Not possible The OpenCode log starts ticked along with the defaults
An upload callback Not possible A successful upload reports its ID and issue link, even if the dialog was closed mid-upload; a failed upload reports nothing

The screenshot now shows the whole window, so no caller has to name a pane:

Screenshot Before After
Label Screenshot of the Agent Mode pane Screenshot of the Obsidian window
Offered Only while an Agent Chat pane is open Always
Contents The first Agent Chat pane, revealed first if hidden The whole window of the pane the user last worked in: the main window, or a popout
Dialogs in that window Settings closed for the capture Every open dialog, Settings included, hidden for the capture and shown again

Non goal

  • Any new caller; the feedback card arrives in the next step.
  • Changing the dialog's layout, report bundle or upload pipeline.
  • Changing which attachments are ticked when opened from Settings.
  • Redacting the screenshot. It can now include open notes; the dialog already warns that screenshots are not redacted, and the user reviews the zip before uploading.

Screenshot

The drafted state, from the component gallery story Agent Mode/Report Issue Flow/DraftedNote:

Report an issue with the drafted note, every attachment ticked, and the Screenshot of the Obsidian window label

The screenshot.png bundled from Settings → Report an issue, opened over a note with Settings inside the main window. Settings and the dialog are hidden for the capture:

Bundled screenshot showing the main window with the note and outline, without Settings or the dialog

Risk

Medium

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, ReportIssueFlow and reportScreenshot tests cover the drafted note, the pre-ticked OpenCode log, the upload callback, which window is captured, and hiding and restoring dialogs; whether the hidden dialogs have been painted out before Electron reads the frame can only be checked in a real Obsidian window
A defect would fail CI or be obvious on first use ✅ A screenshot that still shows the dialog or Settings is visible on the review page's first use
A revert fully restores prior state, including persisted data ✅ Nothing is persisted
No auth, permissions, secrets, or input-handling surface changes ❌ The uploadable screenshot, ticked by default, now shows the whole window, including open notes
No public API, plugin API, message, or on-disk contract changes ✅ Internal module export only; the bundle still carries one screenshot.png
No core-path concurrency, async-lifecycle, or state-machine changes ✅ The capture still runs inside the existing prepare step; the callback fires after the existing upload resolves
No hot-path behavior lacks deterministic coverage ✅ Not on a hot path
No new dependency ✅ Dependency manifests are unchanged
Human-only behavior stays in one feature area and surfaces quickly ✅ Confined to the Report an issue dialog

Review: read captureWindowBehindDialogs in src/agentMode/ui/reportScreenshot.ts and prepare in src/agentMode/ui/ReportIssueModal.tsx, then run Verification steps 2-4.

Verification

  1. Install this build in a test vault and open a note.
  2. Open Settings → Advanced → Report an issue. The dialog opens with an empty description and Screenshot of the Obsidian window ticked along with the same attachments as before. Prepare and upload a report; your browser opens the prefilled GitHub issue (do not submit it).
  3. Open Report an issue again, press Prepare report, then Show zip and open screenshot.png. It shows the whole main window with your note, without Settings or the dialog, and both are back on screen afterwards. Press Cancel.
  4. Move a note into a popout window, click into it, then repeat step 3 from Settings. The screenshot is of the popout.

@vercel

vercel Bot commented Oct 13, 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 4:50am UTC

Request Review

@zeroliu

zeroliu commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-15T04:40:06.841946Z 22f7b7f 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: 273fbae0ac

ℹ️ 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 thread src/agentMode/ui/ReportIssueFlow.tsx
Comment on lines +335 to +336
if (outcome.ok) {
this.params.onReported?.({ reportId: outcome.reportId, issueUrl: outcome.issueUrl });

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 callback branch

Link the originating issue in a nearby explanatory comment and in the it(...) descriptions covering both outcomes of this new success-only callback branch. The commit references issue 672, but neither the branch nor its success/failure tests preserve that URL as required for newly introduced behavioral paths.

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

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added in a6a4b00: an issue-linked comment on the outcome.ok branch, and the issue URL in both the success and failure it(...) descriptions.

const outcome = await uploadReport(this.params.uploader, report);
this.uploading = false;
if (outcome.ok) {
this.params.onReported?.({ reportId: outcome.reportId, issueUrl: outcome.issueUrl });

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 Isolate callback failures from the completed upload

Guard this notification callback so a synchronous exception cannot reject upload() after the server has already accepted the report. In that scenario ReviewPage.runUpload() has no rejection handler and remains in the uploading state instead of opening the issue; if the dialog was closed mid-upload, the exception also skips the fallback notice containing the otherwise unrecoverable report ID.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not changed. The only caller (#3566) passes AgentSession.markFeedbackReported, a synchronous state update with nothing that can throw, so a try/catch would guard a case that cannot happen.

label: "OpenCode backend log",
description: "may include unrelated sessions",
defaultChecked: false,
defaultChecked: this.params.preselectAllSources === true,

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 Apply preselectAllSources to the activity log

When debugFullFrames is false, the activity-log source remains visible but defaultChecked is false, and this new option only overrides the OpenCode source here. Consequently a feedback-card caller requesting preselectAllSources: true still receives a form where the activity log is unticked, contrary to the option's all-sources contract; apply the option consistently when constructing every source rather than special-casing one backend log.

AGENTS.md reference: AGENTS.md:L21-L21

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not changed on purpose. When the activity log is turned off it records nothing: activityLogRequest returns only unavailableReason. Ticking it would attach an 'unavailable' note and no data. The option ticks every source that has something to attach.

Comment thread src/agentMode/ui/ReportIssueModal.tsx Outdated
Comment on lines +79 to +80
dismissSettings: () => {
(app as unknown as { setting: { close: () => void } }).setting.close();

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 Do not close Settings for non-settings callers

Make Settings dismissal caller-specific instead of hard-wiring it into the reusable opener. When a feedback card in an Agent pane popout opens this modal while Settings remains open in the main window, the report overlay and capture target share the popout, so screenshot preparation invokes this callback and unexpectedly closes the unrelated Settings window even though the report did not originate there.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in a6a4b00. openReportIssueModal takes an origin element. When one is passed, the dialog captures the Agent leaf that contains it and leaves Settings alone. Only the Settings button, which passes no origin, still closes Settings. Covered by "captures the chat a report was opened from and leaves Settings open".

@zeroliu
zeroliu added this pull request to stack #3595 October 13, 2026 02:07
@zeroliu
zeroliu force-pushed the zeroliu/report-issue-prefill branch from 273fbae to a6a4b00 Compare October 13, 2026 02:24
@github-actions github-actions Bot added size/M and removed size/S labels Oct 13, 2026
@zeroliu
zeroliu force-pushed the zeroliu/report-issue-prefill branch from a6a4b00 to 7cee4d6 Compare October 13, 2026 21:26
@zeroliu
zeroliu marked this pull request as ready for review October 14, 2026 21:07
@github-actions github-actions Bot added size/L and removed size/M labels Oct 14, 2026
zeroliu and others added 3 commits October 14, 2026 15:02
openReportIssueModal builds the dialog from the app alone, so callers
outside settings can open it. Callers can seed the note, pre-check every
attachment and hear when an upload lands. Settings now goes through it.

Relates to Brevilabs/obsidian-copilot-private#672

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop two assertions that checked a private params shape or repeated the
default-unchecked test, and link issue #672 on the preselectAllSources branch
and its test. The rebase onto master also drops the unused ReportIssueModal
re-export from the agentMode barrel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The report's screenshot is now the window of the pane the user was last
working in, with every open dialog (Settings included) hidden for the
capture. Errors outside the chat are now visible, and no caller has to
say which Agent pane to photograph, so the origin, leaf-reveal,
capture-target and settle-polling plumbing is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zeroliu
zeroliu force-pushed the zeroliu/report-issue-prefill branch from b56c954 to 22f7b7f Compare October 14, 2026 22:11
@zeroliu

zeroliu commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 22f7b7f5df

ℹ️ 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 thread src/agentMode/ui/reportScreenshot.ts Outdated
Comment on lines +52 to +54
const all = remote.BrowserWindow?.getAllWindows?.() ?? [];
if (all.length === 0) return current;
if (all.length === 1) return all[0];

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 popout BrowserWindow resolution

Add a captureWindowBehindDialogs() test using a non-global Window and multiple mocked BrowserWindows. The current tests exercise only the domWindow === window shortcut, while the modal test mocks this function entirely, so the new geometry-based popout selection—including its zero-, one-, and multiple-window branches—has no observable unit coverage even though it determines which potentially sensitive window is captured.

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

Useful? React with 👍 / 👎.

zeroliu and others added 2 commits October 14, 2026 21:41
Each Obsidian window exposes window.electron, whose remote.getCurrentWindow()
is that window's BrowserWindow. Reading it from the target window drops the
require("electron") call and the bounds matching that guessed which
BrowserWindow a popout belonged to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
openReportIssueModal takes the plugin and reads manifest.version like the
rest of the codebase, instead of reaching through app.plugins.getPlugin with
an untyped cast. Settings gets the plugin from usePlugin(), which also
replaces its own getPlugin lookup of the active session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size/M and removed size/L labels Oct 15, 2026

This branch has not been deployed

No deployments
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