Skip to content

禁止 CLI 为结构题配置追问 - #4

Merged
Shimada666 merged 2 commits into
mainfrom
fix/structured-question-follow-up
Aug 10, 2026
Merged

禁止 CLI 为结构题配置追问#4
Shimada666 merged 2 commits into
mainfrom
fix/structured-question-follow-up

Conversation

@Shimada666

Copy link
Copy Markdown
Collaborator

问题

前端只为 open_ended 保留 followUp / timeBudget,但 CLI 此前会向所有题型透传 --follow-up,导致结构题产生无效追问字段。

修改

  • 创建题目时拒绝结构题携带 followUp / timeBudget,包括 --payload
  • 更新追问时按当前题型校验;仅在需要判断题型时读取 outline。
  • CLI help、README 与 mizzen-cli skill 示例统一为:结构题省略 --follow-up

验证

  • bun test:8 passed
  • bun run typecheck
  • bun run bundle
  • git diff --check

边界

本 PR 只阻止 CLI 新写入无效字段;历史数据清理和 Backend Open API 兜底校验不在本 PR。

@Shimada666
Shimada666 requested a review from mizzenbot August 10, 2026 10:29

@github-actions github-actions 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.

Taste Rating: 🟡 可接受(Acceptable)

Linus-Style Analysis
创建路径校验直接且合理,但更新路径对陈述题的题型解码与校验函数不一致,导致可绕过本 PR 的限制。

[CRITICAL ISSUES]

  • 已在内联标出:陈述题更新时会把 questionType: null 误判为开放题。

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟡 MEDIUM
    改动集中且无依赖变更,但该绕过会继续向后端写入本 PR 明确要禁止的无效追问字段。

VERDICT:
Needs rework:修正陈述题回读的类型判定并补充覆盖该更新路径的回归测试后再合并。

KEY INSIGHT:
校验当前题型时必须复用创建路径对 itemType: statement 的语义,而不能仅依赖可为空的 questionType


Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:

  1. Add a .agents/skills/custom-codereview-guide.md file to your branch (or edit it if one already exists) with the /codereview trigger and the context the reviewer is missing (e.g., "Security concerns about X do not apply here because Y"). See the customization docs for the required frontmatter format.
  2. Re-request a review - the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
  3. When your PR is merged, the guideline file goes through normal code review by repository maintainers.

Resolve with AI? Install the iterate skill in your agent and run /iterate to automatically drive this PR through CI, review, and QA until it's merge-ready.

Was this review helpful? React with 👍 or 👎 to give feedback.


Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/MizzenAI/mizzen-cli/actions/runs/31379320399

Comment thread src/commands/questions.ts Outdated

async function getQuestionType(slug: string, questionId: string): Promise<string> {
const outline = await getClient().get<OutlineResponse>(`/interviews/${slug}/outline`)
return findQuestion(outline, questionId).questionType ?? "open_ended"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 重要: OutlineItem.questionType 可为 null,而已有 statement 在大纲中由 itemType: "statement" 表示。这里将它回退为 open_ended,因此 outline question update <slug> <statement-id> --payload '{"followUp":"none"}' 会通过校验并继续 PATCH 无效字段,绕过了本 PR 宣称覆盖的“更新追问时按当前题型校验”。请像 assertFollowUpSupported 一样先根据 itemType 识别陈述题,并新增该更新路径的回归测试。

@Shimada666
Shimada666 requested review from mizzenbot and removed request for mizzenbot August 10, 2026 10:33

@github-actions github-actions 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.

Taste Rating: 🟢 好品味(Good taste)

Linus-Style Analysis
修复复用了同一题型解析逻辑,itemType: statement 不再因可空的 questionType 被误判为开放题;创建、更新和 --payload 的校验边界一致。未发现新的重要问题。

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟢 LOW
    改动仅在 CLI 客户端拒绝无效字段,无依赖或 API 路径变更;既有陈述题更新路径已覆盖。

VERDICT:
值得合并:核心逻辑可靠。

KEY INSIGHT:
题型判定集中在 resolveQuestionType,避免创建与回读语义再次分叉。

本审查由 AI agent(OpenHands)代表用户生成。


Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/MizzenAI/mizzen-cli/actions/runs/31379638686

@Shimada666
Shimada666 merged commit b030475 into main Aug 10, 2026
1 check passed
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