orca icon indicating copy to clipboard operation
orca copied to clipboard

fix: pr-bug-scan validated finding from #2138

Open buf0-bot[bot] opened this issue 6 months ago • 0 comments

Automated fix-PR from pr-bug-scan for parent #2138.

Fixer status: FIXED_WITH_CODE_PROOF Summary: Threaded operation tag through SSH executeCommitMessagePlan/cancelGenerateCommitMessage and relay lane key; reverted commit-message emptyResultName from 'details' to default. Blocked proof link: src/main/ipc/filesystem.ts:782 — git:cancelGeneratePullRequestFields now calls provider.cancelGenerateCommitMessage(worktreePath, 'pull-request-fields'); the relay lane key in src/relay/agent-exec-handler.ts now includes operation, so cancel/exec for PR fields no longer collides with the commit-message lane. C3 blocked at src/main/text-generation/commit-message-text-generation.ts:463-464 by reverting emptyResultName to 'message' for commit-message path. Typecheck: skipped

Proof (from validator)

  • C1 — proof_type: code_analysis
    • trigger: User on an SSH worktree starts AI commit-message generation, then opens the Create PR dialog and starts AI PR-fields generation (or the reverse). User cancels one of them.
    • observable: The other in-flight generation aborts with 'Generation canceled.' even though the user only intended to stop one of them; the user loses unsubmitted work.
    • path:
      • src/main/ipc/filesystem.ts:782 — git:cancelGeneratePullRequestFields handler calls provider.cancelGenerateCommitMessage(args.worktreePath) on SSH
      • src/main/runtime/orca-runtime-git.ts:454 — runtime cancelRuntimeGeneratePullRequestFields also calls provider?.cancelGenerateCommitMessage(target.worktree.path)
      • src/main/ipc/filesystem.ts (cancelGenerateCommitMessage handler) — same provider.cancelGenerateCommitMessage(worktreePath) call, identical key
      • src/main/text-generation/commit-message-text-generation.ts:201-209 — locally the PR adds per-operation lane keys (${operation}:local:${cwd}), proving the author knew distinct lanes are required to avoid collision; only the remote dispatcher omits this
  • C3 — proof_type: code_analysis
    • trigger: User runs Generate Commit Message and the agent returns empty/whitespace stdout.
    • observable: Toast text reads 'agent returned an empty details.' (ungrammatical) instead of 'agent returned an empty message.'
    • path:
      • src/main/text-generation/commit-message-text-generation.ts:462 — generateCommitMessageFromContext passes emptyResultName='details' to both runRemotePlan and runLocalPlan
      • src/main/text-generation/commit-message-text-generation.ts:364 — finalizeFromAgentOutput emits ${label} returned an empty ${emptyResultName}. when cleaned output is empty
      • the PR's intent (per the new generatePullRequestFieldsFromContext at line 502) was to use 'details' only for the PR path; passing 'details' to the commit-message path is a copy/paste regression

Generated by pr-bug-scan (proof-machine architecture). Human approval required before merge.

buf0-bot[bot] avatar May 17 '26 19:05 buf0-bot[bot]