Repository navigation
Export a thread as one redacted HTML bug report (#394) - #1675
Conversation
Solenta-Message-Id: 95489d2d-0ae8-40bd-be13-8bcb63155597
…-as-a-self-contained-reda-0dc01e # Conflicts: # src/components/ThreadView.tsx # src/dev/threads.ts
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa9cfae490
ℹ️ 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".
| /** @param {unknown} value @returns {string} */ | ||
| const text = (value) => { | ||
| const raw = String(value ?? ""); | ||
| let s = threadSecrets.redact(threadId, raw); |
There was a problem hiding this comment.
Redact short secret-card values before export
When a user supplies a secret of five characters or fewer and that value appears in a tool call, output, or diff, this call leaves it unchanged because threadSecrets.redact deliberately ignores values shorter than six characters. The HTML exporter then writes the known secret verbatim unless it coincidentally matches another pattern, violating the export's guarantee that secret-request-card values are removed.
Useful? React with 👍 / 👎.
| for (const [scope, fallback] of [["branch", "Committed on branch"], ["uncommitted", "Uncommitted"]]) { | ||
| try { | ||
| const d = await diff({ store: ctx.store, threadId, scope }); | ||
| if (d.patch) diffs.push({ label: d.scopeLabel ? `${fallback} (${d.scopeLabel})` : fallback, patch: d.patch }); |
There was a problem hiding this comment.
Include untracked files in the exported changes
When the relevant work consists of newly created, untracked files, worktrees.diff reports them only through d.files; its Git patch remains empty because git diff does not include untracked content. Since the exporter retains only d.patch, a report for an entirely untracked fix says “No changes,” omitting the code most likely needed to reproduce the bug.
Useful? React with 👍 / 👎.
| const d = await diff({ store: ctx.store, threadId, scope }); | ||
| if (d.patch) diffs.push({ label: d.scopeLabel ? `${fallback} (${d.scopeLabel})` : fallback, patch: d.patch }); |
There was a problem hiding this comment.
Export patches omitted by the diff preview budget
When a changed file exceeds the 60 KB per-file limit or the scope exceeds the 100 KB aggregate preview budget, worktrees.diff drops that file from d.patch and records the omission only in d.files[].patchOmitted. The exporter ignores that metadata, so large changes silently disappear from the supposedly complete report; it should retrieve the omitted file patches or at least disclose that they were excluded.
Useful? React with 👍 / 👎.
| for (const [scope, fallback] of [["branch", "Committed on branch"], ["uncommitted", "Uncommitted"]]) { | ||
| try { | ||
| const d = await diff({ store: ctx.store, threadId, scope }); |
There was a problem hiding this comment.
Separate committed changes from working-tree changes
When tracked uncommitted changes exist, the branch scope compares the merge base directly with the working tree, so those edits are already included in the section labeled “Committed on branch.” The following uncommitted scope exports the same edits again, making the report mislabel and duplicate them; the committed section needs to end at HEAD rather than use the existing branch-preview scope unchanged.
Useful? React with 👍 / 👎.
| "speech:cancel", | ||
| ], | ||
| files: ["projects:writeAgentConfig", "workflows:exportToRepo"], | ||
| files: ["projects:writeAgentConfig", "workflows:exportToRepo", "threads:exportReport"], |
There was a problem hiding this comment.
Keep the native export dialog out of web scope
When a paired Solenta Web device has files access, this classification allows it to invoke the endpoint even though export is documented as desktop-only. The web bridge preserves the desktop context's dialog, so the request opens a save dialog on the host machine rather than failing on the web client; the remote request then waits for host interaction and any returned path refers to an inaccessible host file. Reject web transport or keep this native-dialog channel host-only.
Useful? React with 👍 / 👎.
Reporting an agent bug used to mean screenshotting a terminal. The thread's overflow menu now has Export bug report…: it saves one HTML file with no external dependencies, ready to attach to a vendor issue or send to a teammate. Secrets are redacted before anything is written. Closes #394.
Changes
<bin> --version, token count, cost) and the environment (Solenta, OS, Electron, Node).~. The report header says how many secrets were removed and by which pattern.--versionwork entirely.Verification
electron/test/threadReport.test.jschecks that no secret pattern, secret-card value, bearer token, PEM body or home path survives, that HTML is escaped, that placeholders likeyour-key-…are kept, and that cancelling writes nothing.test/threadHeader.test.tsxcovers the menu item: a cancel shows no confirmation, a save flashes "Saved".npm run typecheck(including the preload sync check) andnpx vite buildpass.test:electron: 22 tests failed in codex, grok MCP, PR refresh and terminal sign-in. The run was alongsidevite build. I reran the 10 failing files one at a time: all passed on this branch, and the 9 that finished on clean HEAD passed there too. Not rerun as a full suite after merging main.Notes for reviewers
redactor()inelectron/threadReport.js. The privacy gateway (Privacy gateway: PII/secret redaction before context leaves the machine #295) isn't built yet, so this reuses the guardrail patterns, andguardrails.jsonly gains two exports. Redaction is pattern-based, so a token in an unrecognised format would still leak; the report tells the reader to review it before sharing.🤖 Generated with Claude Code