[codex] Add multilingual issue preservation coverage (#6069)
## Thinking Path > - Paperclip orchestrates AI agents for autonomous companies. > - Agents and board operators coordinate through company-scoped issues, comments, documents, and heartbeat wake payloads. > - Chinese, Japanese, and Hindi text needs to survive the full issue lifecycle without normalization or prompt serialization damage. > - The riskiest paths are board issue creation, server issue/comment/document round-tripping, and scoped wake prompt rendering. > - This pull request adds focused regression coverage across those surfaces. > - The benefit is higher confidence that multilingual operators and agents can create, search, comment on, complete, and wake on issues using non-Latin text. ## What Changed - Added adapter-utils wake payload and prompt rendering coverage for Chinese, Japanese, and Hindi issue/comment text. - Added UI New Issue dialog coverage proving multilingual title and description text is submitted unchanged. - Added server route coverage that round-trips multilingual issue text through create, search, comments, documents, completion comments, and heartbeat context. - Addressed Greptile feedback by using a typed storage mock and splitting the server route integration path into smaller ordered assertions. ## Verification - `pnpm exec vitest run packages/adapter-utils/src/server-utils.test.ts ui/src/components/NewIssueDialog.test.tsx server/src/__tests__/multilingual-issues-routes.test.ts` - Result: 3 test files passed, 51 tests passed. ## Risks - Low risk: this PR adds regression coverage only and does not change runtime behavior. - The new server test uses embedded Postgres support and skips on unsupported hosts using the existing helper pattern. - No migrations are included. - No `pnpm-lock.yaml` changes are included. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected - check the roadmap first. See `CONTRIBUTING.md`. ## Model Used - OpenAI Codex, GPT-5 based coding agent, with shell, git, Vitest, and GitHub connector/CLI tool use. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] If this change affects the UI, I have included before/after screenshots - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] I will address all Greptile and reviewer comments before requesting merge
This commit is contained in:
@@ -462,6 +462,50 @@ describe("renderPaperclipWakePrompt", () => {
|
||||
expect(prompt).toContain("named unblock owner/action");
|
||||
});
|
||||
|
||||
it("preserves Chinese, Japanese, and Hindi issue and comment text in scoped wake prompts", () => {
|
||||
const title = "验证中文任务";
|
||||
const commentBody = [
|
||||
"请用中文回复。",
|
||||
"日本語: 次の手順を書いてください。",
|
||||
"हिन्दी: कृपया स्थिति बताएं।",
|
||||
].join("\n");
|
||||
const payload = {
|
||||
reason: "issue_commented",
|
||||
issue: {
|
||||
id: "issue-1",
|
||||
identifier: "PAP-9452",
|
||||
title,
|
||||
status: "in_progress",
|
||||
workMode: "standard",
|
||||
},
|
||||
commentIds: ["comment-1"],
|
||||
latestCommentId: "comment-1",
|
||||
commentWindow: { requestedCount: 1, includedCount: 1, missingCount: 0 },
|
||||
comments: [
|
||||
{
|
||||
id: "comment-1",
|
||||
body: commentBody,
|
||||
author: { type: "user", id: "board-user-1" },
|
||||
createdAt: "2026-05-15T16:30:00.000Z",
|
||||
},
|
||||
],
|
||||
fallbackFetchNeeded: false,
|
||||
};
|
||||
|
||||
const serialized = stringifyPaperclipWakePayload(payload);
|
||||
expect(serialized).toContain(title);
|
||||
expect(serialized).toContain("日本語");
|
||||
expect(serialized).toContain("हिन्दी");
|
||||
expect(JSON.parse(serialized ?? "{}")).toMatchObject({
|
||||
issue: { title },
|
||||
comments: [{ body: commentBody }],
|
||||
});
|
||||
|
||||
const prompt = renderPaperclipWakePrompt(payload);
|
||||
expect(prompt).toContain(`- issue: PAP-9452 ${title}`);
|
||||
expect(prompt).toContain(commentBody);
|
||||
});
|
||||
|
||||
it("renders planning-mode directives for assignment and comment wakes", () => {
|
||||
const assignmentPrompt = renderPaperclipWakePrompt({
|
||||
reason: "issue_assigned",
|
||||
|
||||
Reference in New Issue
Block a user