Skip to content

fix: instruct fix agent to write summaries in Simplified Chinese - #169

Open
cwbcheng wants to merge 6 commits into
jeremymcs:mainfrom
cwbcheng:codex/chinese-agent-summaries
Open

fix: instruct fix agent to write summaries in Simplified Chinese#169
cwbcheng wants to merge 6 commits into
jeremymcs:mainfrom
cwbcheng:codex/chinese-agent-summaries

Conversation

@cwbcheng

@cwbcheng cwbcheng commented Aug 6, 2026

Copy link
Copy Markdown

Problem

When PatchDeck resolves a review thread, the follow-up comment posted to GitHub mixes languages: the title line is Chinese (已在提交 \abc1234` 中处理。) but the agent summary is English, because the fix-agent prompt (buildAgentFixPrompt`) never told the agent which language to use. Only the code-owner fallback prompt contained the Chinese-language instruction.

Example posted on PR #434:

已在提交 45fca2f 中处理。

Restructured generate_installation_config.py so the --dry-run branch returns before assert_identity ... (English)

Fix

Add a language instruction to buildAgentFixPrompt so every summary block the fix agent emits (posted as follow-up comments on the PR) is written in Simplified Chinese, matching the existing Chinese templates and the code-owner fallback prompt.

Tests

  • Extended the existing comment-task test to assert the fix-agent prompt instructs write every summary block in Simplified Chinese.
  • Verified: node --import tsx --test server/babysitter.test.ts (110 tests pass), npm run check passes.

Rejected review-thread feedback previously fell through the GitHub
follow-up path silently: needsGitHubFollowUp only considered accepted
items, so a rejected review comment was never replied to and its
conversation was never resolved, contradicting the agent prompt that
says to reply with the rejection reason and resolve the conversation.

Now rejected review threads (excluding PatchDeck's own status/audit-trail
replies) are collected as follow-up tasks, get a 'Rejected - no code
change made' reply with the reason, and the conversation is resolved.
Audit-trail verification skips the code-change audit for these items and
only requires thread resolution, and the final status update keeps the
rejection decision while advancing the thread-resolved flag.
Localize the comments PatchDeck posts to GitHub:
- Agent prompt now requires Simplified Chinese for every comment,
  thread reply, and summary.
- Follow-up replies use Chinese headlines (已拒绝/已在提交/已在最新更新)
  with 原因 for rejected threads, and 正在回复 for quoted references.
- Status messages (accepted/in-progress/needs-attention/verifying/resolved)
  are localized.
- APP_STATUS_COMMENT_PATTERN now recognizes both English and Chinese
  status markers so recovery of existing status replies keeps working.

Tests updated to assert the Chinese wording.
The internal-reply exclusion in needsGitHubFollowUp only matched
'PatchDeck status comment' and 'Automation audit trail follow-up', but
classifyNonActionableAppFeedback also produces 'PatchDeck audit trail
comment' and 'PatchDeck agent command comment'. A rejected item carrying
one of those reasons was treated as real reviewer feedback, which made
PatchDeck reply to its own follow-up comment, producing a new audit
trail, which was then replied to again - an infinite loop.

Widen the exclusion to all PatchDeck-authored marker reasons and add a
regression test that a rejected audit-trail comment never triggers a
follow-up reply.
The code-owner fallback agent is asked to commit and push its own
changes, but agents sometimes finish without doing so (e.g. a truncated
model response). Previously PatchDeck marked the fallback run completed
and removed the worktree, discarding the agent's edits and leaving the
PR branch and review threads untouched.

After a successful fallback agent run, PatchDeck now:
- commits any uncommitted agent edits in the worktree,
- pushes the local head to the PR head branch,
- verifies the remote head matches the local head.

Adds a regression test that a fallback agent leaving uncommitted edits
results in git add/commit/push to the PR branch.
The DeepSeek-backed codex agent frequently times out on long review
comments: evaluation had a 3-minute cap and apply had a 15-minute cap,
which was not enough for multi-file fixes (e.g. 21 generated fixtures).
When apply timed out mid-run, the uncommitted worktree edits were
discarded.

Raise evaluation to 7 minutes and the default apply timeout to 30
minutes (matching the code-owner fallback timeout) so complex review
threads can be evaluated and fixed to completion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant