Skip to content

feat(cli)!: remove deprecated per-client boolean flags - #465

Merged
junhoyeo merged 1 commit into
mainfrom
chore/remove-deprecated-client-flags
Jun 22, 2026
Merged

feat(cli)!: remove deprecated per-client boolean flags#465
junhoyeo merged 1 commit into
mainfrom
chore/remove-deprecated-client-flags

Conversation

@junhoyeo

@junhoyeo junhoyeo commented Apr 25, 2026

Copy link
Copy Markdown
Owner

Breaking change — targets v3.2.0. Removes the deprecated, hidden per-client boolean flags (--opencode, --claude, --codex, …); use the canonical --client/-c instead. These flags have been hidden from --help and emitting a deprecation warning since #464 (pre-v3.0.0), so the migration window is well past.

⚠️ After 3.2.0, tokscale --opencode (etc.) hard-errors with unexpected argument. Migrate scripts to --client.

Re-cut on current main (2026-06-18)

The original branch was ~2 months stale (19 flags then; main now has 32, and build_client_filter is home_dir-aware). This branch was re-cut fresh on current main.

What changed

  • Remove all 32 hidden legacy bool fields from ClientFlags.
  • Simplify build_client_filter_with_defaults to the single canonical --client path + defaultClients fallback (drops the legacy mapping array and emit_legacy_client_flag_warning).
  • Add id = "client_filter" / value_name = "CLIENTS" to the --client arg (avoids a clap id collision now that the bool fields are gone; keeps the <CLIENTS> help placeholder).
  • Tests: a table-driven guard asserting all 32 removed flags now produce a clap parse error, plus positive --client opencode | opencode,claude | synthetic tests. ~61 legacy-flag sites in cli_tests.rs migrated to --client.
  • Remove the README deprecation-notice paragraph.

Migration

Before After
tokscale --opencode tokscale --client opencode
tokscale --opencode --claude tokscale --client opencode,claude
tokscale --synthetic tokscale --client synthetic

Verified locally: cargo build/clippy/fmt clean; 669 bin + 122 integration tests pass; --opencode rejected, --client opencode works.

🤖 Re-cut with Claude Code

@vercel

vercel Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
tokscale Ignored Ignored Preview Jun 18, 2026 1:05pm

Request Review

@junhoyeo

Copy link
Copy Markdown
Owner Author

Update: Oracle review — addressed LOW finding + rebased on updated #464

LOW: legacy-rejection guard was too narrow

The original `test_client_flags_legacy_long_flags_rejected` only checked `--claude`. Expanded to a table over all 19 removed flags with `--synthetic` called out explicitly — it's the only legacy flag without a matching `ClientId`, so its handling has always been special-cased and is the most likely to regress if anyone resurrects a boolean field. Also added a positive sanity sweep to verify `--client opencode`, `--client claude`, and `--client synthetic` all still parse, so the negative test cannot silently pass via an over-tight parser.

Pushed as `f1caf3d test(cli): expand legacy-flag rejection guard to all 19 removed flags`.

Rebased on updated #464

Branch was rebased after `308b471` landed on `feat/cli-client-filter-flag`. The rebase pulls in:

  • The HIGH-severity `ClientFilter::default_set()` fix (no-filter TUI / warm-cache mismatch)
  • The MEDIUM-severity README example migration (stale `--claude` / `--opencode` examples in non-deprecation sections)

So once #464 lands, this branch's diff collapses cleanly to just the removal commits with no carryover noise.

Numbers (this branch only)

PR remains DRAFT — DO NOT MERGE until v3.0.0.

@junhoyeo
junhoyeo force-pushed the chore/remove-deprecated-client-flags branch from 467c10f to d87330b Compare April 25, 2026 21:44
@junhoyeo
junhoyeo marked this pull request as ready for review June 16, 2026 08:48

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 13 files

Re-trigger cubic

Removes all 32 hidden legacy `--<client>` boolean flags (opencode, claude,
codex, …, synthetic). Use the canonical `--client/-c` flag instead
(e.g. `--client opencode,claude`).

Simplifies build_client_filter to resolve canonical `--client` values then
fall back to `defaultClients`, drops the legacy[] array, the legacy_used
collection, and the emit_legacy_client_flag_warning deprecation warning.
Targets v3.2.0.

Constraint: breaking change — removed flags now hard-error; landing in 3.2.0 per maintainer decision
Confidence: high
Scope-risk: moderate
@junhoyeo
junhoyeo force-pushed the chore/remove-deprecated-client-flags branch from d87330b to 7d137a4 Compare June 18, 2026 13:05
@junhoyeo
junhoyeo merged commit 7355f57 into main Jun 22, 2026
13 checks passed
@junhoyeo
junhoyeo deleted the chore/remove-deprecated-client-flags branch June 22, 2026 05:01
junhoyeo added a commit that referenced this pull request Jun 22, 2026
The per-client flag removal (#465) is a breaking change, so the next release is v4.0.0, not v3.2.0. Update the migration notes in all four README locales and the main.rs doc comment accordingly.
junhoyeo added a commit that referenced this pull request Jun 22, 2026
…746)

* docs: sync EN/ja/ko/zh-cn for unreleased clients + breaking flag removal

Pre-v3.2.0 documentation sync for the unreleased range (v3.1.3..main):

- #465: replace the now-false legacy per-client flag notices in ja/ko/zh-cn
  (they claimed the removed flags still work) with a v3.2.0 breaking-change
  migration note; add the same note to README.md (which had none).
- #728: document the MiniMax Token Plan subscription source (distinct from the
  MINIMAX_API_KEY row) in all locales; port the entire Subscription Usage
  section into ja/ko/zh-cn (was English-only).
- #718: add the Jcode table row + detail section to the locales missing them.
- #726: document the TOKSCALE_FM_DEBUG env var in all locales.
- #633: add the missing task-attributed report bullet to README.ja Key Features.
- drift: add Junie to the frontend Source-filtering list (all locales).
- #710: fix the MiMo Code repo link (XiaomiMiMo/MiMo -> XiaomiMiMo/MiMo-Code).
- #717: disclose Command Code token usage is estimated (~4 chars/token).

Confidence: medium
Scope-risk: narrow
Directive: ja/ko/zh-cn translations of the ported Subscription Usage section are machine-generated and should get a native-speaker review pass
Not-tested: #713 Antigravity CLI detail section was not added — no English source section exists to port from

* fix(report): feed real session content to the summarizer (#633)

extract_content_for_session unconditionally returned metadata_only_content()
(first_user_message hardcoded None), so the report summarizer never saw any
conversation content and the four real per-client extractors were dead code.

Add content_extractor::extract_session_content, which dispatches to the correct
per-client extractor (opencode/claude/codex/gemini) and falls back to
metadata-only — never erroring or panicking — for unknown clients, missing
candidates, or unreadable/unparseable files. report.rs builds a SessionPathIndex
once (session_id -> transcript file, plus opencode DBs) and threads it through
run_summarizer so each payload carries the real first user message.

Confidence: high
Scope-risk: moderate
Rejected: thread file paths through core's scanner/WikiEntry | too invasive; indexed at the report layer instead
Not-tested: end-to-end opencode/codex/gemini extraction in report.rs (core dispatcher covers claude + all fallback paths; per-client extractors are pre-existing)

* docs: name the breaking release v4.0.0 (was v3.2.0)

The per-client flag removal (#465) is a breaking change, so the next release is v4.0.0, not v3.2.0. Update the migration notes in all four README locales and the main.rs doc comment accordingly.

* fix(report): real Codex/Gemini extraction + (client,session_id) index keying

Addresses automated review feedback on the #633 report-summarizer-content
fix (PR #746). The summarizer still surfaced (none) for normal Codex/Gemini
sessions and could mis-route cross-client session_id collisions.

- content_extractor: parse the current on-disk Codex format (event_msg with
  payload.type == "user_message", text in payload.message) and skip
  harness-injected context blocks (<environment_context>/<system-reminder>/
  <user_instructions>), mirroring sessions::codex.
- content_extractor: Gemini extractor now handles chat-recording JSON
  (messages[].type == "user" / content) and falls back to scanning
  line-delimited JSONL; empty/whitespace user text is treated as not-found.
- extract_session_content: an empty/whitespace first_user_message no longer
  counts as success, so scanning continues to a later candidate with real text.
- report: SessionPathIndex is keyed by (client, session_id) to prevent
  cross-client collisions, and Gemini files are keyed by their in-file
  sessionId (via gemini_session_id_for_file) rather than the filename stem,
  since the wiki entry's session_id is derived from inside the file.
- Added fixture-based regression tests for all of the above.

Constraint: wiki session_id for Gemini comes from the in-file sessionId, not the path stem
Rejected: match any leading '<' for Codex injected blocks | drops legit prompts starting with markup
Confidence: high
Scope-risk: narrow
pinion05 added a commit to pinion05/tokscale that referenced this pull request Jun 23, 2026
Removes all 32 hidden legacy `--<client>` boolean flags (opencode, claude,
codex, …, synthetic). Use the canonical `--client/-c` flag instead
(e.g. `--client opencode,claude`).

Simplifies build_client_filter to resolve canonical `--client` values then
fall back to `defaultClients`, drops the legacy[] array, the legacy_used
collection, and the emit_legacy_client_flag_warning deprecation warning.
Targets v3.2.0.

Constraint: breaking change — removed flags now hard-error; landing in 3.2.0 per maintainer decision
Confidence: high
Scope-risk: moderate
t1000040 pushed a commit to tmobi-internal/tokscale that referenced this pull request Jun 30, 2026
Removes all 32 hidden legacy `--<client>` boolean flags (opencode, claude,
codex, …, synthetic). Use the canonical `--client/-c` flag instead
(e.g. `--client opencode,claude`).

Simplifies build_client_filter to resolve canonical `--client` values then
fall back to `defaultClients`, drops the legacy[] array, the legacy_used
collection, and the emit_legacy_client_flag_warning deprecation warning.
Targets v3.2.0.

Constraint: breaking change — removed flags now hard-error; landing in 3.2.0 per maintainer decision
Confidence: high
Scope-risk: moderate
t1000040 pushed a commit to tmobi-internal/tokscale that referenced this pull request Jun 30, 2026
…unhoyeo#746)

* docs: sync EN/ja/ko/zh-cn for unreleased clients + breaking flag removal

Pre-v3.2.0 documentation sync for the unreleased range (v3.1.3..main):

- junhoyeo#465: replace the now-false legacy per-client flag notices in ja/ko/zh-cn
  (they claimed the removed flags still work) with a v3.2.0 breaking-change
  migration note; add the same note to README.md (which had none).
- junhoyeo#728: document the MiniMax Token Plan subscription source (distinct from the
  MINIMAX_API_KEY row) in all locales; port the entire Subscription Usage
  section into ja/ko/zh-cn (was English-only).
- junhoyeo#718: add the Jcode table row + detail section to the locales missing them.
- junhoyeo#726: document the TOKSCALE_FM_DEBUG env var in all locales.
- junhoyeo#633: add the missing task-attributed report bullet to README.ja Key Features.
- drift: add Junie to the frontend Source-filtering list (all locales).
- junhoyeo#710: fix the MiMo Code repo link (XiaomiMiMo/MiMo -> XiaomiMiMo/MiMo-Code).
- junhoyeo#717: disclose Command Code token usage is estimated (~4 chars/token).

Confidence: medium
Scope-risk: narrow
Directive: ja/ko/zh-cn translations of the ported Subscription Usage section are machine-generated and should get a native-speaker review pass
Not-tested: junhoyeo#713 Antigravity CLI detail section was not added — no English source section exists to port from

* fix(report): feed real session content to the summarizer (junhoyeo#633)

extract_content_for_session unconditionally returned metadata_only_content()
(first_user_message hardcoded None), so the report summarizer never saw any
conversation content and the four real per-client extractors were dead code.

Add content_extractor::extract_session_content, which dispatches to the correct
per-client extractor (opencode/claude/codex/gemini) and falls back to
metadata-only — never erroring or panicking — for unknown clients, missing
candidates, or unreadable/unparseable files. report.rs builds a SessionPathIndex
once (session_id -> transcript file, plus opencode DBs) and threads it through
run_summarizer so each payload carries the real first user message.

Confidence: high
Scope-risk: moderate
Rejected: thread file paths through core's scanner/WikiEntry | too invasive; indexed at the report layer instead
Not-tested: end-to-end opencode/codex/gemini extraction in report.rs (core dispatcher covers claude + all fallback paths; per-client extractors are pre-existing)

* docs: name the breaking release v4.0.0 (was v3.2.0)

The per-client flag removal (junhoyeo#465) is a breaking change, so the next release is v4.0.0, not v3.2.0. Update the migration notes in all four README locales and the main.rs doc comment accordingly.

* fix(report): real Codex/Gemini extraction + (client,session_id) index keying

Addresses automated review feedback on the junhoyeo#633 report-summarizer-content
fix (PR junhoyeo#746). The summarizer still surfaced (none) for normal Codex/Gemini
sessions and could mis-route cross-client session_id collisions.

- content_extractor: parse the current on-disk Codex format (event_msg with
  payload.type == "user_message", text in payload.message) and skip
  harness-injected context blocks (<environment_context>/<system-reminder>/
  <user_instructions>), mirroring sessions::codex.
- content_extractor: Gemini extractor now handles chat-recording JSON
  (messages[].type == "user" / content) and falls back to scanning
  line-delimited JSONL; empty/whitespace user text is treated as not-found.
- extract_session_content: an empty/whitespace first_user_message no longer
  counts as success, so scanning continues to a later candidate with real text.
- report: SessionPathIndex is keyed by (client, session_id) to prevent
  cross-client collisions, and Gemini files are keyed by their in-file
  sessionId (via gemini_session_id_for_file) rather than the filename stem,
  since the wiki entry's session_id is derived from inside the file.
- Added fixture-based regression tests for all of the above.

Constraint: wiki session_id for Gemini comes from the in-file sessionId, not the path stem
Rejected: match any leading '<' for Codex injected blocks | drops legit prompts starting with markup
Confidence: high
Scope-risk: narrow
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