v0.19.9#151
Conversation
Add --quiet/-q flag to suppress token summary and budget warnings. Both global and project sync paths call buildAnalyzeEntries after SyncSummary to display context cost and budget violations.
Always included in --json mode regardless of --quiet flag. Contains grouped token counts and budget violation warnings.
Reuses checkBudget from sync_budget.go. No top-offender list since analyze already shows the full per-skill breakdown.
DiscoverSourceSkillsWithStats did not set collectContext=true, so DescChars/BodyChars were always 0 when sync called buildAnalyzeEntries. Add DiscoverSourceSkillsWithStatsAndContext that enables both ignore stats and context collection in a single walk, and use it in sync.go and sync_project.go.
Self-contained token estimation (chars/4) since buildAnalyzeEntries is in main package. Returns grouped counts and budget violations.
- Define budgetTypeAlwaysLoaded/budgetTypeOnDemand constants - Add showDetails param to printBudgetWarning; analyze reuses it - Hoist buildAnalyzeEntries call to avoid duplicate computation - Remove WHAT-comments that restate function names
Both global and project schemas now recognize context_budget, resolving the 'Unknown field' warning in the Config page.
The assistant panel already shows field documentation via JSON schema. A static reference card is redundant and breaks the page's interaction pattern of cursor-driven contextual help.
Context budget warnings (issue #150), --quiet flag, Web UI context cost display, and HTTP protocol install fix.
…xample Also documents context_budget config block in configuration reference with field types, defaults, and cross-link to sync docs.
All 11 locales: en, zh-TW, zh-CN, ja, ko, de, es, fr, pt-BR, id, fa.
There was a problem hiding this comment.
Code Review
This pull request introduces token budget management and context cost summaries for the sync and analyze commands. Key features include a one-line token cost summary after syncing, configurable budget thresholds in config.yaml with associated warnings for offenders, a new --quiet flag to suppress these messages, and integration of these costs into the Web UI. Review feedback highlights significant logic duplication between the CLI and server components regarding context cost calculation, which should be refactored into a shared package. Additionally, the checkBudget function is noted for only reporting the single worst offender rather than all targets exceeding the budget, and a large block in ConfigPage.tsx was flagged for inconsistent indentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 719a6800ed
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
| } | ||
| return syncOutputJSON(results, dryRun, start, projIgnoreStats, err) | ||
| return syncOutputJSON(results, dryRun, start, projIgnoreStats, err, nil) |
There was a problem hiding this comment.
Include context_cost in project JSON sync responses
Project-mode sync always passes nil for the context-cost payload here, so skillshare sync -p --json omits context_cost even though this release’s contract says JSON output should include it (with --quiet only affecting text output). This creates inconsistent behavior between global and project sync and can break consumers that rely on the new field.
Useful? React with 👍 / 👎.
- Project mode JSON sync now includes context_cost (was nil) - Server handler respects symlink mode (skips include/exclude filters) - checkBudget reports all targets exceeding threshold (not just worst) - Budget warnings include target name in CLI and UI output - ConfigPage indentation restored to original 2-space style
skillshare syncnow displays a one-line token cost summary showing always-loaded and on-demand context usage per target. Targets with identical token counts are grouped on a single line. Refs: feat: surface always-loaded token cost duringsync+ configurable context budget warning #150config.yaml. Whensyncoranalyzedetects a target exceeding the budget, a warning shows the top 3 offenders by token count0to disable--quiet/-qflag for sync — suppresses the token summary and budget warnings. JSON output (--json) always includescontext_costregardless of--quietref: #150