Skip to content

Offer a bug report with private data removed when pdt hits an unexpected error - #91

Closed
autoidm-jon wants to merge 1 commit into
mainfrom
bug-report
Closed

autoidm-jon wants to merge 1 commit into
mainfrom
bug-report

Conversation

@autoidm-jon

Copy link
Copy Markdown
Contributor

An uncaught exception in pdt or a provider script now saves a report (command, versions, OS, provider, traceback) with .env values, account ids, app names, paths, emails, and tokens removed, and offers to open a prefilled new-issue page on the public GitHub repository, because the GitLab project is private; nothing is sent until the user presses Submit.

🤖 Generated with Claude Code


Moved from GitLab autoidm/pdt!151 (https://gitlab.com/autoidm/pdt/-/merge_requests/151), opened by autoidm-jon on 2026-09-29.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

PR tier: tier::architectural (rules and Claude agree)

  • AGENTS.md is repo rules
  • agree with floor — AGENTS.md gains a new layout rule for src/pdt/bug_report.py and rewrites the "Anything written to disk outside the project" section to cover bug-reports
  • secret and credential handling: bug_report.known_secrets() collects every .env value and non-public platform key, and scrub()'s PATTERNS list is the only barrier before that text goes into a public GitHub issue URL
  • new user-facing behaviour on every uncaught error — bug_report.install() replaces sys.excepthook in cli.main and in deploy_aws/azure/google_cloud/windows main(), then opens a browser
  • new data written outside the project (config.data_home()/pdt/bug-reports in save()), a location the team should agree on before release

A changed diff is scored again. Job log: https://github.com/AutoIDM/pdt/actions/runs/37006898248

…ted error

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@autoidm-jon

Copy link
Copy Markdown
Contributor Author

When pdt stops on an error that is a bug in pdt itself (an uncaught exception, not a config error), pdt saves a report with private data removed to the user's data folder and offers to open a prefilled new-issue page on the public GitHub repository. Nothing is sent until the user presses Submit on GitHub.

Reviewer: Cursor gpt-5.6-luna-high.

Review of the conflict resolutions in the rebase onto main.

# Severity Disposition Finding Action
1 blocker not changed in this rebase; decision for the PR owner bug_report.offer opens issue_url(title, body), which puts the report in the query string. The browser sends that URL to GitHub when the page opens, before Submit, so "nothing is sent until Submit" is not exact (src/pdt/bug_report.py:179, docs/commands.md:51). This is the design of the PR, not a conflict resolution. The two choices are to open a blank issue page and ask the user to paste the saved report, or to say in the docs that opening the page sends the report with private data removed to GitHub.
2 should-fix fixed The rebase installed the hook after build_parser() and completion.configure(), so a crash there did not reach the bug report. The PR had installed it first. cli.run now installs the hook first, except during tab completion. New test test_a_crash_while_building_the_parser_reaches_the_bug_report_hook fails without the fix.

Resolutions in this rebase:

  • main's error watcher (watch.watched) caught every exception and printed the traceback itself, so the hook of this PR never ran. It now passes the exception to sys.excepthook, and a test covers that.
  • The hook is installed in cli.run, which main added, and the import is skipped during tab completion.
  • The README text moved to docs/commands.md and docs/projects.md, following the docs split on main.
  • A test fixture resets sys.excepthook after each test, so no test writes a report to the real data folder.

Checks that passed:

  • uv run pytest -q: 2540 passed, 9 skipped
  • uv run --group dev ruff check: all checks passed

@autoidm-jon

Copy link
Copy Markdown
Contributor Author

Closing: #305 (pdt support) replaces this. It covers reports after an unexpected error. With no coding agent available, its report holds only the command shape, the exception type, pdt's own trace lines, and versions. With an agent, the agent checks the report for secrets, and the user confirms the report before anything goes to GitHub. This PR opens a prefilled issue URL, and opening that URL sends the report text to GitHub before the user confirms.

@autoidm-jon autoidm-jon closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant