fix: Enforce multi-round clarification in lite-plan and lite-fix

Add explicit instructions to execute ALL clarification rounds when >4
questions exist. AskUserQuestion tool limits max 4 per call, so multi-round
execution is mandatory to exhaust all clarification needs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-11-29 23:44:00 +08:00
parent c67817f46e
commit 1dbffbee2d
2 changed files with 16 additions and 0 deletions

View File

@@ -293,6 +293,8 @@ Angles diagnosed: ${diagnosisManifest.diagnoses.map(d => d.angle).join(', ')}
**Skip if**: No diagnosis or `clarification_needs` is empty across all diagnoses **Skip if**: No diagnosis or `clarification_needs` is empty across all diagnoses
**⚠️ CRITICAL**: AskUserQuestion tool limits max 4 questions per call. **MUST execute multiple rounds** to exhaust all clarification needs - do NOT stop at round 1.
**Aggregate clarification needs from all diagnosis angles**: **Aggregate clarification needs from all diagnosis angles**:
```javascript ```javascript
// Load manifest and all diagnosis files // Load manifest and all diagnosis files
@@ -330,10 +332,16 @@ function deduplicateClarifications(clarifications) {
const uniqueClarifications = deduplicateClarifications(allClarifications) const uniqueClarifications = deduplicateClarifications(allClarifications)
// Multi-round clarification: batch questions (max 4 per round) // Multi-round clarification: batch questions (max 4 per round)
// ⚠️ MUST execute ALL rounds until uniqueClarifications exhausted
if (uniqueClarifications.length > 0) { if (uniqueClarifications.length > 0) {
const BATCH_SIZE = 4 const BATCH_SIZE = 4
const totalRounds = Math.ceil(uniqueClarifications.length / BATCH_SIZE)
for (let i = 0; i < uniqueClarifications.length; i += BATCH_SIZE) { for (let i = 0; i < uniqueClarifications.length; i += BATCH_SIZE) {
const batch = uniqueClarifications.slice(i, i + BATCH_SIZE) const batch = uniqueClarifications.slice(i, i + BATCH_SIZE)
const currentRound = Math.floor(i / BATCH_SIZE) + 1
console.log(`### Clarification Round ${currentRound}/${totalRounds}`)
AskUserQuestion({ AskUserQuestion({
questions: batch.map(need => ({ questions: batch.map(need => ({

View File

@@ -282,6 +282,8 @@ Angles explored: ${explorationManifest.explorations.map(e => e.angle).join(', ')
**Skip if**: No exploration or `clarification_needs` is empty across all explorations **Skip if**: No exploration or `clarification_needs` is empty across all explorations
**⚠️ CRITICAL**: AskUserQuestion tool limits max 4 questions per call. **MUST execute multiple rounds** to exhaust all clarification needs - do NOT stop at round 1.
**Aggregate clarification needs from all exploration angles**: **Aggregate clarification needs from all exploration angles**:
```javascript ```javascript
// Load manifest and all exploration files // Load manifest and all exploration files
@@ -319,10 +321,16 @@ function deduplicateClarifications(clarifications) {
const uniqueClarifications = deduplicateClarifications(allClarifications) const uniqueClarifications = deduplicateClarifications(allClarifications)
// Multi-round clarification: batch questions (max 4 per round) // Multi-round clarification: batch questions (max 4 per round)
// ⚠️ MUST execute ALL rounds until uniqueClarifications exhausted
if (uniqueClarifications.length > 0) { if (uniqueClarifications.length > 0) {
const BATCH_SIZE = 4 const BATCH_SIZE = 4
const totalRounds = Math.ceil(uniqueClarifications.length / BATCH_SIZE)
for (let i = 0; i < uniqueClarifications.length; i += BATCH_SIZE) { for (let i = 0; i < uniqueClarifications.length; i += BATCH_SIZE) {
const batch = uniqueClarifications.slice(i, i + BATCH_SIZE) const batch = uniqueClarifications.slice(i, i + BATCH_SIZE)
const currentRound = Math.floor(i / BATCH_SIZE) + 1
console.log(`### Clarification Round ${currentRound}/${totalRounds}`)
AskUserQuestion({ AskUserQuestion({
questions: batch.map(need => ({ questions: batch.map(need => ({