Skip to content

fix: ask user before proceeding when corpus fits in context window#376

Open
sanchaymittal wants to merge 1 commit intosafishamsi:v4from
sanchaymittal:fix/warn-small-corpus-before-proceeding
Open

fix: ask user before proceeding when corpus fits in context window#376
sanchaymittal wants to merge 1 commit intosafishamsi:v4from
sanchaymittal:fix/warn-small-corpus-before-proceeding

Conversation

@sanchaymittal
Copy link
Copy Markdown

Problem

When detect() returns a non-empty warning field (e.g. "Corpus is ~5,005 words - fits in a single context window. You may not need a graph."), the skill's Step 2 action list silently ignored it and fell through to Otherwise: proceed directly — running the full pipeline, dispatching semantic subagents, and burning tokens unnecessarily.

The warning existed in the library output but had no corresponding stop-and-ask logic in the skill.

Fix

Add a check between the large-corpus branch and the Otherwise fallthrough:

- If the `warning` field is non-empty (e.g. corpus fits in a single context window):
  display the warning to the user and ask whether to proceed or answer directly
  without building a graph. Wait for the user's answer before proceeding.

Applied to skill.md and all platform variants (skill-aider.md, skill-claw.md, skill-codex.md, skill-copilot.md, skill-droid.md, skill-kiro.md, skill-opencode.md, skill-trae.md, skill-windows.md).

Test plan

  • Run /graphify on a small repo (<10 files, <10k words) — should display the warning and pause for confirmation
  • Run /graphify on a large repo (>10k words, no warning) — should proceed as before without prompting
  • Confirm all platform variant skill files contain the new check

When detect() returns a non-empty warning field (e.g. "Corpus fits in a
single context window"), the skill silently ignored it and ran the full
pipeline anyway — burning tokens on semantic subagents unnecessarily.

Add a check: if warning is non-empty, display it and ask the user
whether to proceed or answer directly without building a graph.

Applies to skill.md and all platform variants (aider, claw, codex,
copilot, droid, kiro, opencode, trae, windows).
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