#934·openwiki

[Bug]: openwiki --init token explosion (10M+) and silent process stall

Author: MrHhhhhhhhCreated Sep 24, 2026Updated Sep 26, 2026
Labelsbug

Description

When running openwiki --init on a project, the initial indexing process suffers from severe token overconsumption and silent failures/loops:

Token Overconsumption & Silent Stalling: On the initial run, the process consumed around 10M tokens. While the CLI terminal output continued to display a status of processing..., inspecting .last-update.json revealed that the process had actually stalled or interrupted internally without throwing an error or updating the CLI state.

Excessive File Reads & Context Explosion: After configuring an ignore file (e.g., .gitignore / .openwikiignore) and enabling LangSmith tracing, a second run was attempted. Generating just the first Markdown documentation file consumed 2.6M tokens and triggered 55 file read operations.

Steps to Reproduce

Run openwiki --init on a repository for the first time without custom ignore configurations.

Observe the terminal output remaining stuck on processing... while token usage climbs rapidly (~10M tokens consumed).

Inspect .last-update.json and observe that internal processing has stalled/interrupted despite the CLI presenting an active state.

Add an ignore file (e.g., .openwikiignore / .gitignore) and configure LangSmith for tracing.

clear .run.json and re-run openwiki --init.

Trace the run via LangSmith while generating the first .md file.

Expected Behavior

openwiki --init should complete codebase indexing with reasonable token usage and structured file reads.

If an internal process fails, errors out, or stalls, the CLI should properly terminate or log an explicit error instead of silently hanging on processing....

File ignore rules should significantly scope down context ingestion to prevent redundant file reads.

Actual Behavior

First run: Consumed ~10M tokens. The terminal displayed processing..., but .last-update.json confirmed the execution was silently interrupted/stalled.

Second run: Even with ignore rules active, generating a single .md file consumed 2.6M tokens and triggered 55 file read calls, indicating a potential context explosion or unoptimized read loop.

Environment

  • OS: MacOS 15.3.2
  • Node.js version: 22.21.1
  • OpenWiki version: v0.5.1
  • model: GLM-5.3-flash

Additional Context

No response