Skip to content

#4: plain tj onboard honors --plan / prompts for plan tier - #148

Merged
anilmurty merged 3 commits into
mainfrom
fix/4-onboard-plain-plan
Jun 19, 2026
Merged

anilmurty merged 3 commits into
mainfrom
fix/4-onboard-plain-plan

Conversation

@anilmurty

Copy link
Copy Markdown
Contributor

Closes #4 (from the v0.3.5 smoke test #141 — HIGH).

Plain tj onboard only prompted for daily budget and silently ignored
--plan
(_prompt_plan was wired only into the --claude-code / --codex
flows), so [budget.<provider>] plan was never written — breaking plan-aware
dollar rendering and contradicting the docs/CLAUDE.md.

Fix

  • The plain path now honors --plan <tier> non-interactively and prompts
    for it interactively. It's Claude-first: the prompt offers the Anthropic tiers,
    an OpenAI-only --plan (plus/team/enterprise) is routed to [budget.openai],
    everything else to [budget.anthropic].
  • Non-interactive with no --plan writes no plan section (no hang under
    CI/non-TTY, no presumptuous default) — current behavior preserved when unused.
  • Added a confirmation line ("Plan tier: api (written to [budget.anthropic])")
    and updated the CLAUDE.md onboard wording.

The --claude-code / --codex global integration flows are unchanged.

Tests

tests/unit/test_onboard_plan.py: --plan writes the right
[budget.<provider>] section (api/max_5x → anthropic, plus → openai), no-plan
non-interactive writes none, and the generated config parses as valid TOML.
Full suite green (711); ruff check tokenjam/ + mypy clean.

Note

The reporter ran tj onboard --plan api --force and got a silent no-op — that
exact case now writes [budget.anthropic] plan = "api".

anilmurty and others added 3 commits June 18, 2026 16:58
Plain `tj onboard` only prompted for daily budget and silently ignored
`--plan`, so `[budget.<provider>] plan` was never written — breaking
plan-aware dollar rendering and contradicting the docs.

- The plain path now honors `--plan <tier>` non-interactively and prompts for
  it interactively (Claude-first: offers the Anthropic tiers). An OpenAI-only
  tier (plus/team/enterprise) is routed to `[budget.openai]`; everything else
  to `[budget.anthropic]`. Non-interactive with no `--plan` writes no plan
  section (no hang, no presumptuous default).
- Confirmation line + CLAUDE.md wording updated to match.

The `--claude-code` / `--codex` global integration flows are unchanged.

Tests: --plan writes the right [budget.<provider>] section (api/max_5x →
anthropic, plus → openai), no-plan non-interactive writes none, output is valid
TOML. Full suite green (711); ruff/mypy clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@anilmurty
anilmurty merged commit 4d50d7e into main Jun 19, 2026
4 checks passed
@anilmurty
anilmurty deleted the fix/4-onboard-plain-plan branch June 19, 2026 00:36
HoomanDgtl pushed a commit to HoomanDigital/tokenjam that referenced this pull request Jun 20, 2026
TokenJam v0.4.0 — major release. Significant new product surface beyond
the 0.3.x patch cadence:

- TokenJam Lens UI rebrand: Overview triage front door, Optimize detail
  tab, real charts (uPlot, vendored offline), URL-state filters,
  plan-tier-aware framing on all dollar-bearing surfaces.
- Reuse — the 5th analyzer + `tj report --reuse` artifact export
  (HTML + Markdown skeleton sidecars).
- New `core/framing.py` — single source of truth for plan-tier
  rendering, consumed by both CLI and REST API.
- `estimated_recoverable_usd` contract on every savings analyzer
  (Metabuilder-Labs#111), normalized to a single time basis (Metabuilder-Labs#122) so Overview tiles
  are directly comparable.
- `cache_write_tokens` surfaced through DB → API → CLI → UI (Metabuilder-Labs#149) —
  fixed the ~91% hidden cost driver on cache-heavy workloads.
- Security: `.tj/config.toml` untracked (Metabuilder-Labs#145) + CI guard
  (`tests/unit/test_no_tracked_dev_secrets.py`).
- 17 v0.3.5 post-release findings closed (Metabuilder-Labs#141) + 5 Lens UI bug rounds
  (Metabuilder-Labs#126-Metabuilder-Labs#136) + onboard `--plan` honored on plain path (Metabuilder-Labs#148).

## Also in this commit

**Step 6 in the pre-release checklist** is corrected to match real
behavior: `tj report --reuse` with the daemon running exits with the
"needs direct database access" hint (workaround: `tj stop`). Long-term
fix tracked as Metabuilder-Labs#154 for v0.4.1.

**Test outputs committed.** `tests/results/` was gitignored; flipping
it so per-release pre-release test logs ship as part of the repo for
historical reference. Two v0.4.0 result logs included: the first pass
(which surfaced two bugs fixed in PR Metabuilder-Labs#153) and the clean re-run after
those fixes landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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