Skip to content

test(api): agents(wikiCompose / research ノード・core tools)の未テストノードにテストを追加する (#1033) - #1042

Merged
otomatty merged 1 commit into
developfrom
cursor/agents-wiki-compose-tests-d046
Jun 11, 2026
Merged

test(api): agents(wikiCompose / research ノード・core tools)の未テストノードにテストを追加する (#1033)#1042
otomatty merged 1 commit into
developfrom
cursor/agents-wiki-compose-tests-d046

Conversation

@otomatty

@otomatty otomatty commented Jun 11, 2026

Copy link
Copy Markdown
Owner

概要

Issue #1033 の受け入れ条件に沿い、server/api agents 層の未テストノード 7 ファイルに単体テストを追加しました。LLM / 外部 HTTP はモック境界とし、ノードの state 変換契約を検証しています。あわせて #976 と整合するよう draftSections のセクション失敗時メッセージをユーザー向けの汎用文言に変更しました。

変更点

server/api/src/__tests__/agents/

  • graphs/wikiCompose/nodes/draftSections.test.ts — セクション単位ストリーミング、部分失敗時の継続、エラー詳細非漏洩
  • graphs/wikiCompose/nodes/briefDialogue.test.ts — 質問生成、pageSnapshot 読み込み、LLM 失敗時 briefDegraded
  • graphs/wikiCompose/nodes/humanReviewBrief.test.ts — interrupt/resume の状態遷移、スキーマ拒否
  • subgraphs/research/nodes/fetchArticles.test.ts — 部分 fetch 成功、in-place 昇格、5 件上限
  • core/tools/resolveWebSearchModel.test.ts — モデル解決優先順位(固定 ID → env override → 最安 OpenAI)
  • subgraphs/research/tools/webSearch.test.ts — LLM 成功/失敗パスを追加(内部ヘルパはモックしない)
  • core/llm/usageCallback.test.tstoZediMessages、0 トークン usage の具体値検証を追加

server/api/src/agents/

変更の種類

  • 🐛 バグ修正 (Bug fix)
  • ✨ 新機能 (New feature)
  • 💥 破壊的変更 (Breaking change)
  • 📝 ドキュメント (Documentation)
  • 🎨 スタイル/リファクタリング (Style/Refactor)
  • 🧪 テスト (Tests)
  • 🔧 ビルド/CI (Build/CI)

テスト方法

  1. cd server/api && bunx vitest run src/__tests__/agents/graphs/wikiCompose/nodes/ src/__tests__/agents/subgraphs/research/nodes/fetchArticles.test.ts src/__tests__/agents/core/tools/resolveWebSearchModel.test.ts src/__tests__/agents/subgraphs/research/tools/webSearch.test.ts src/__tests__/agents/core/llm/usageCallback.test.ts
  2. カバレッジ確認: 上記パスに --coverage--coverage.include で対象 7 ファイルを指定(いずれも Lines 80% 以上)
  3. 回帰: cd server/api && bunx vitest run(1604 tests green)

チェックリスト

  • テストがすべてパスする
  • Lint エラーがない(pre-commit format check 通過)
  • 必要に応じてドキュメントを更新した(該当なし)
  • コミットメッセージが Conventional Commits に従っている

スクリーンショット(UI 変更がある場合)

該当なし(バックエンドテストのみ)

関連 Issue

Closes #1033
Related to #976

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes

    • Prevented provider error text from appearing in drafted sections; failing sections now show a generic retry message.
    • Ensured usage/cost reporting behaves correctly in audit-only and zero-token edge cases.
  • Tests

    • Added broad test coverage for usage tracking, web-search model selection, dialogue generation, section drafting, human review flows, article fetching, and web search behavior.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39cab1ac-0b59-4925-baf0-0d7b2f40b6fa

📥 Commits

Reviewing files that changed from the base of the PR and between 2bf70a5 and b23be77.

📒 Files selected for processing (8)
  • server/api/src/__tests__/agents/core/llm/usageCallback.test.ts
  • server/api/src/__tests__/agents/core/tools/resolveWebSearchModel.test.ts
  • server/api/src/__tests__/agents/graphs/wikiCompose/nodes/briefDialogue.test.ts
  • server/api/src/__tests__/agents/graphs/wikiCompose/nodes/draftSections.test.ts
  • server/api/src/__tests__/agents/graphs/wikiCompose/nodes/humanReviewBrief.test.ts
  • server/api/src/__tests__/agents/subgraphs/research/nodes/fetchArticles.test.ts
  • server/api/src/__tests__/agents/subgraphs/research/tools/webSearch.test.ts
  • server/api/src/agents/graphs/wikiCompose/nodes/draftSections.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • server/api/src/tests/agents/core/tools/resolveWebSearchModel.test.ts
  • server/api/src/tests/agents/graphs/wikiCompose/nodes/draftSections.test.ts
  • server/api/src/tests/agents/subgraphs/research/nodes/fetchArticles.test.ts
  • server/api/src/tests/agents/graphs/wikiCompose/nodes/humanReviewBrief.test.ts
  • server/api/src/agents/graphs/wikiCompose/nodes/draftSections.ts
  • server/api/src/tests/agents/graphs/wikiCompose/nodes/briefDialogue.test.ts
  • server/api/src/tests/agents/core/llm/usageCallback.test.ts
  • server/api/src/tests/agents/subgraphs/research/tools/webSearch.test.ts

📝 Walkthrough

Walkthrough

Adds Vitest suites across agents (usageCallback, resolveWebSearchModel, briefDialogue, draftSections, humanReviewBrief, fetchArticles, webSearch) with mocked LLM/external boundaries, and changes draftSections to log errors and persist a generic retry message instead of provider error text.

Changes

Test Coverage for Untested Agents Nodes

Layer / File(s) Summary
LLM Usage Callback Tests
server/api/src/__tests__/agents/core/llm/usageCallback.test.ts
LangChain message imports added; recordZediUsage tests now validate full return object ({ inputTokens, outputTokens, costUnits }) across BYOK/audit-only and system billing modes, including zero-token edge cases; toZediMessages tests verify role mapping (SystemMessage/AIMessage/HumanMessage) and multi-part text content concatenation.
Web Search Model Resolution Tests
server/api/src/__tests__/agents/core/tools/resolveWebSearchModel.test.ts
New test suite for resolveWebSearchModelId covering fixed-model precedence when active and tier-accessible, environment-variable override validation against allowed tiers, cheapest-model tie-breaking fallback, and null return when no eligible models exist.
Brief Dialogue Node Tests
server/api/src/__tests__/agents/graphs/wikiCompose/nodes/briefDialogue.test.ts
New test suite verifying page-snapshot load-on-miss with cache reuse, LLM structured output projection into briefQuestions, briefDegraded flag management, and phase transition to brief:await_user on both success and LLM failure.
Draft Sections Tests and Error Handling
server/api/src/__tests__/agents/graphs/wikiCompose/nodes/draftSections.test.ts, server/api/src/agents/graphs/wikiCompose/nodes/draftSections.ts
New test suite validating empty-outline passthrough, streaming aggregation into section body, citation extraction from [#N] markers, and per-section failure isolation: failed sections log errors and receive a fixed generic retry message without provider error details; partial streamed content is preserved when a stream errors mid-section. Implementation change removes error-message embedding from section body and logs to console.error.
Human Review Brief Node Tests
server/api/src/__tests__/agents/graphs/wikiCompose/nodes/humanReviewBrief.test.ts
New test suite verifying interrupt payload structure and answer projection into state, including appendToExisting/answers/summary fields; empty-answers case indicates "(no brief provided)" with appendToExisting=false; researchMaxIterations validated to 1..5 range; questionId field required in answers.
Research Flow Tests
server/api/src/__tests__/agents/subgraphs/research/nodes/fetchArticles.test.ts, server/api/src/__tests__/agents/subgraphs/research/tools/webSearch.test.ts
New test suite for fetchArticles verifying empty pendingSources passthrough, in-place kind upgrade on success, failure isolation without cross-contamination, and 5-candidate-per-iteration rate limit. webSearch harness updated to inject DB-backed model resolution; tests verify DB-throw error envelope, successful structured-output result shape with stable src:<64 hex chars> ids, and LLM-failure non-throwing error envelope.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #1033: test(api): agents(wikiCompose / research ノード・core tools)の未テストノードにテストを追加する — This PR implements the requested tests and the draftSections error-handling observance.
  • #976: draftSections provider error leakage — The draftSections change (console.error + generic retry message) matches the remediation outlined in #976.

Possibly related PRs

  • otomatty/zedi#990: Related to resolveWebSearchModelId behavior and tests around fixed wiki-compose model precedence.
  • otomatty/zedi#985: Overlaps on draftSections streaming behavior; both PRs touch per-section drafting logic and error handling.

Poem

🐰 I hopped through code with test-filled paws,
Seven nodes tended without a pause.
Errors logged, secrets kept from view,
Drafts and briefs now tested true.
Cheers — a carrot for CI passing soon!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the primary change: adding unit tests for previously untested agent nodes in wikiCompose/research components and core tools.
Linked Issues check ✅ Passed All seven target files now have comprehensive test coverage meeting the stated objectives, including error handling, state transitions, token aggregation, and partial success scenarios.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue #1033; one production code change (draftSections.ts) aligns with issue #976 as documented.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/agents-wiki-compose-tests-d046

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces comprehensive unit tests for several agent nodes, tools, and utility functions, including usageCallback, resolveWebSearchModel, briefDialogue, draftSections, humanReviewBrief, fetchArticles, and webSearchTool. Additionally, it updates the error handling in draftSections.ts to log errors and return a generic failure message to avoid leaking raw provider error details. The review feedback suggests improving this error handling by appending the generic failure message to any partially streamed content when a draft fails mid-stream, rather than silently preserving the partial content, and updating the corresponding unit test accordingly.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +185 to +186
console.error("[draftSections] per-section draft error:", err);
body = body || "*(Section draft failed. Please retry drafting this section.)*";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If a section draft fails mid-stream, body will contain the partially streamed content. Using body = body || ... means the partial content is preserved as-is, but the user is never notified that the draft failed mid-way and is incomplete.\n\nConsider appending the generic failure message to the partial content so the user is aware of the interruption.\n\nNote: If you apply this change, you will also need to update the corresponding unit test preserves partial streamed content when the stream throws mid-section in draftSections.test.ts to expect the appended fallback message.

      console.error("[draftSections] per-section draft error:", err);\n      const fallback = "*(Section draft failed. Please retry drafting this section.)*";\n      body = body ? `${body}\\n\\n${fallback}` : fallback;

config as never,
);

expect(update.draftedSections?.[0]?.body).toBe("Partial");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If you update the implementation in draftSections.ts to append the generic failure message to partially drafted content, update this assertion to expect the appended fallback message.

Suggested change
expect(update.draftedSections?.[0]?.body).toBe("Partial");
expect(update.draftedSections?.[0]?.body).toBe("Partial\\n\\n*(Section draft failed. Please retry drafting this section.)*");

@otomatty
otomatty marked this pull request as ready for review June 11, 2026 04:03
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@server/api/src/__tests__/agents/core/tools/resolveWebSearchModel.test.ts`:
- Around line 1-4: The file-level header comments in
resolveWebSearchModel.test.ts are English-only; update the file header to
include a Japanese translation alongside the existing English text to satisfy
the repo policy for bilingual comments (for .ts files). Edit the top-of-file
comment block used for the `resolveWebSearchModelId` unit tests and prepend or
append the equivalent Japanese description (matching the English meaning, e.g.,
mention fixed Wiki Compose model → env override → cheapest OpenAI/Google) so
both Japanese and English appear in the header.

In
`@server/api/src/__tests__/agents/graphs/wikiCompose/nodes/briefDialogue.test.ts`:
- Around line 1-5: The file header comment above the briefDialogue unit tests is
English-only; update the top comment in the briefDialogue test (the header block
in
server/api/src/__tests__/agents/graphs/wikiCompose/nodes/briefDialogue.test.ts)
to include a concise Japanese translation alongside the existing English lines
so the header contains bilingual documentation per policy—preserve the existing
English lines and add equivalent Japanese sentences describing the test purpose
and behavior (e.g., mention loading page snapshot, projecting briefQuestions,
and LLM failure degrading to empty questions with briefDegraded=true).

In
`@server/api/src/__tests__/agents/graphs/wikiCompose/nodes/draftSections.test.ts`:
- Around line 1-6: The file-level doc comment at the top of
draftSections.test.ts is English-only and must include Japanese per the
bilingual rule; update that top comment block (the triple-slash block containing
the three bullets about per-section LLM streaming, section failure behavior, and
user-visible body leakage) to add concise Japanese translations of the same
sentences so the file-level documentation contains both English and Japanese.

In
`@server/api/src/__tests__/agents/graphs/wikiCompose/nodes/humanReviewBrief.test.ts`:
- Around line 1-5: Update the file header comment in humanReviewBrief.test.ts to
include Japanese alongside the existing English lines: locate the top block
comment that currently documents the test purpose and add concise Japanese
translations for each English sentence (e.g., describe the unit tests, interrupt
payload shape and resume projection into state.brief, and allowed/disallowed
resume payloads/schema validation) so the header is bilingual and follows the
repository rule.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9b521ada-4f63-444a-8d3f-6aef0a5e9eff

📥 Commits

Reviewing files that changed from the base of the PR and between c0ac3a7 and 2bf70a5.

📒 Files selected for processing (8)
  • server/api/src/__tests__/agents/core/llm/usageCallback.test.ts
  • server/api/src/__tests__/agents/core/tools/resolveWebSearchModel.test.ts
  • server/api/src/__tests__/agents/graphs/wikiCompose/nodes/briefDialogue.test.ts
  • server/api/src/__tests__/agents/graphs/wikiCompose/nodes/draftSections.test.ts
  • server/api/src/__tests__/agents/graphs/wikiCompose/nodes/humanReviewBrief.test.ts
  • server/api/src/__tests__/agents/subgraphs/research/nodes/fetchArticles.test.ts
  • server/api/src/__tests__/agents/subgraphs/research/tools/webSearch.test.ts
  • server/api/src/agents/graphs/wikiCompose/nodes/draftSections.ts

Comment on lines +1 to +4
/**
* `resolveWebSearchModelId` unit tests (#1033).
* Priority: fixed Wiki Compose model → env override → cheapest OpenAI/Google.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Consolidated: all three new test files have English-only header docs.

Root cause is a single policy mismatch: file-level comments were added in English only, while repo rules require bilingual Japanese+English comments/documentation for .ts files.

As per coding guidelines, "**/*.{ts,tsx,js,jsx,md}: Comments and documentation must include both Japanese and English text".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@server/api/src/__tests__/agents/core/tools/resolveWebSearchModel.test.ts`
around lines 1 - 4, The file-level header comments in
resolveWebSearchModel.test.ts are English-only; update the file header to
include a Japanese translation alongside the existing English text to satisfy
the repo policy for bilingual comments (for .ts files). Edit the top-of-file
comment block used for the `resolveWebSearchModelId` unit tests and prepend or
append the equivalent Japanese description (matching the English meaning, e.g.,
mention fixed Wiki Compose model → env override → cheapest OpenAI/Google) so
both Japanese and English appear in the header.

Source: Coding guidelines

Comment on lines +1 to +5
/**
* `briefDialogue` unit tests (#1033).
* - Loads page snapshot once and projects briefQuestions into state.
* - LLM failure degrades to empty questions with `briefDegraded=true`.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add Japanese text to the test header comment to satisfy repo documentation policy.

Lines 1-5 are English-only; this violates the bilingual comment/documentation requirement for .ts files.

Suggested patch
 /**
- * `briefDialogue` unit tests (`#1033`).
- * - Loads page snapshot once and projects briefQuestions into state.
- * - LLM failure degrades to empty questions with `briefDegraded=true`.
+ * `briefDialogue` unit tests (`#1033`).
+ * `briefDialogue` のユニットテスト (`#1033`)。
+ * - Loads page snapshot once and projects briefQuestions into state.
+ * - pageSnapshot を 1 回だけ読み込み、briefQuestions を state に反映する。
+ * - LLM failure degrades to empty questions with `briefDegraded=true`.
+ * - LLM 失敗時は空の質問へフォールバックし、`briefDegraded=true` を設定する。
  */

As per coding guidelines: **/*.{ts,tsx,js,jsx,md} comments and documentation must include both Japanese and English text.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* `briefDialogue` unit tests (#1033).
* - Loads page snapshot once and projects briefQuestions into state.
* - LLM failure degrades to empty questions with `briefDegraded=true`.
*/
/**
* `briefDialogue` unit tests (`#1033`).
* `briefDialogue` のユニットテスト (`#1033`)
* - Loads page snapshot once and projects briefQuestions into state.
* - pageSnapshot 1 回だけ読み込み、briefQuestions state に反映する。
* - LLM failure degrades to empty questions with `briefDegraded=true`.
* - LLM 失敗時は空の質問へフォールバックし、`briefDegraded=true` を設定する。
*/
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@server/api/src/__tests__/agents/graphs/wikiCompose/nodes/briefDialogue.test.ts`
around lines 1 - 5, The file header comment above the briefDialogue unit tests
is English-only; update the top comment in the briefDialogue test (the header
block in
server/api/src/__tests__/agents/graphs/wikiCompose/nodes/briefDialogue.test.ts)
to include a concise Japanese translation alongside the existing English lines
so the header contains bilingual documentation per policy—preserve the existing
English lines and add equivalent Japanese sentences describing the test purpose
and behavior (e.g., mention loading page snapshot, projecting briefQuestions,
and LLM failure degrading to empty questions with briefDegraded=true).

Source: Coding guidelines

Comment on lines +1 to +6
/**
* `draftSections` unit tests (#1033, #976).
* - Per-section LLM streaming with state projection.
* - One section failure must not abort the whole Draft.
* - User-visible body must not leak raw provider error messages.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add Japanese text to the file-level test doc comment.

Lines 1-6 are English-only comments, which violates the bilingual comment/documentation rule for .ts files.

As per coding guidelines, "**/*.{ts,tsx,js,jsx,md}: Comments and documentation must include both Japanese and English text".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@server/api/src/__tests__/agents/graphs/wikiCompose/nodes/draftSections.test.ts`
around lines 1 - 6, The file-level doc comment at the top of
draftSections.test.ts is English-only and must include Japanese per the
bilingual rule; update that top comment block (the triple-slash block containing
the three bullets about per-section LLM streaming, section failure behavior, and
user-visible body leakage) to add concise Japanese translations of the same
sentences so the file-level documentation contains both English and Japanese.

Source: Coding guidelines

Comment on lines +1 to +5
/**
* `humanReviewBrief` unit tests (#1033).
* - Interrupt payload shape and resume projection into `state.brief`.
* - Allowed and disallowed resume payloads (schema validation).
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Make the file header bilingual (Japanese + English) to match repository rules.

Lines 1-5 currently include only English documentation text.

Suggested patch
 /**
- * `humanReviewBrief` unit tests (`#1033`).
- * - Interrupt payload shape and resume projection into `state.brief`.
- * - Allowed and disallowed resume payloads (schema validation).
+ * `humanReviewBrief` unit tests (`#1033`).
+ * `humanReviewBrief` のユニットテスト (`#1033`)。
+ * - Interrupt payload shape and resume projection into `state.brief`.
+ * - interrupt ペイロード形状と `state.brief` への resume 反映を検証する。
+ * - Allowed and disallowed resume payloads (schema validation).
+ * - 許可/不許可の resume ペイロードをスキーマ検証する。
  */

As per coding guidelines: **/*.{ts,tsx,js,jsx,md} comments and documentation must include both Japanese and English text.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* `humanReviewBrief` unit tests (#1033).
* - Interrupt payload shape and resume projection into `state.brief`.
* - Allowed and disallowed resume payloads (schema validation).
*/
/**
* `humanReviewBrief` unit tests (`#1033`).
* `humanReviewBrief` のユニットテスト (`#1033`)
* - Interrupt payload shape and resume projection into `state.brief`.
* - interrupt ペイロード形状と `state.brief` への resume 反映を検証する。
* - Allowed and disallowed resume payloads (schema validation).
* - 許可/不許可の resume ペイロードをスキーマ検証する。
*/
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@server/api/src/__tests__/agents/graphs/wikiCompose/nodes/humanReviewBrief.test.ts`
around lines 1 - 5, Update the file header comment in humanReviewBrief.test.ts
to include Japanese alongside the existing English lines: locate the top block
comment that currently documents the test purpose and add concise Japanese
translations for each English sentence (e.g., describe the unit tests, interrupt
payload shape and resume projection into state.brief, and allowed/disallowed
resume payloads/schema validation) so the header is bilingual and follows the
repository rule.

Source: Coding guidelines

Add unit tests for draftSections, briefDialogue, humanReviewBrief,
fetchArticles, resolveWebSearchModel, webSearch, and usageCallback.
Each target file reaches 80%+ line coverage. Align draftSections error
fallback with #976: generic user-safe message, append note on partial
stream failure.

Co-authored-by: Akimasa Sugai <otomatty@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/agents-wiki-compose-tests-d046 branch from 2bf70a5 to b23be77 Compare June 11, 2026 04:23
@otomatty
otomatty merged commit edc7478 into develop Jun 11, 2026
20 checks passed
@otomatty
otomatty deleted the cursor/agents-wiki-compose-tests-d046 branch June 11, 2026 04:40
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.

test(api): agents(wikiCompose / research ノード・core tools)の未テストノードにテストを追加する

2 participants