@arhen/pi-senja 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,7 @@ Forked from [pi-haiku](https://github.com/nnocte/pi-haiku) **0.2.0** by **nocte*
13
13
  - **Quiet tool text** — tool titles and output both use the foreground beige (`fg0`) rather than loud accents, keeping panels calm against their tint.
14
14
  - **Editor-style code colors** — pink keywords, olive strings, aqua function names, amber types, warm beige identifiers and punctuation, readable muted comments. Applies to code in tool calls/results and Markdown code blocks through Pi's syntax roles.
15
15
  - **A live timer** while Pi works, plus elapsed-time completion message and notification. Preserves the active mode label and colour from `@arhen/pi-add-mode` (`review is working... 8s`).
16
- - **Fast / Ultrafast mode** — `/fast on|off` and `/ultrafast on|off` toggle OpenAI's paid speed tiers for OpenAI requests (`service_tier: priority` / `ultrafast`). Both off by default; mutually exclusive; persisted in `<agent-dir>/fast-mode.json`. The active tier shows as a footer chip next to the model (`openai ▪ gpt-6.2-sol ▪ xhigh ▪ fast`). A bare `/fast` reports the current state. Per-model `samplingParams.service_tier` in `models.json` still wins.
16
+ - **Fast / Ultrafast mode** — `/fast on|off` and `/ultrafast on|off` toggle OpenAI's paid speed tiers for OpenAI requests (`service_tier: priority` / `ultrafast`). Both off by default; mutually exclusive; persisted in `<agent-dir>/fast-mode.json`. The active tier shows as a footer chip next to the model (`openai ▪ gpt-6.2-sol ▪ xhigh ▪ fast`). A bare `/fast` reports the current state. Setting a tier on a non-OpenAI model, or on a model outside the known support lists (from OpenAI's model catalog and Ultrafast docs), warns that the request may be rejected or ignored — the tier is still sent, since OpenAI is the source of truth. Per-model `samplingParams.service_tier` in `models.json` still wins.
17
17
  - **A fresh start** — clear the visible screen on initial terminal startup without clearing scrollback.
18
18
 
19
19
  Enabled by default in terminal UI mode. Print, JSON, SDK, and RPC modes do not install terminal components, switch themes, clear the screen, or start UI timers. `/senja` in RPC mode reports that terminal UI is required.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arhen/pi-senja",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Senja Gruvbox Material theme with Haiku's structured header, footer, and live timer for Pi.",
5
5
  "license": "MIT",
6
6
  "author": "arhen",
package/src/index.ts CHANGED
@@ -38,6 +38,27 @@ interface RenderHandle {
38
38
 
39
39
  type SpeedTier = "fast" | "ultrafast";
40
40
 
41
+ // Advisory only — OpenAI rejects or silently downgrades unsupported tiers server-side,
42
+ // so unknown models still get the tier; they just warn here. Fast list from OpenAI's
43
+ // model catalog (codex 0.166.0, service_tiers/priority); Ultrafast list from OpenAI's
44
+ // Ultrafast mode docs. Extend as OpenAI ships new tiers/models.
45
+ const SPEED_TIER_SUPPORT: Record<SpeedTier, ReadonlySet<string>> = {
46
+ fast: new Set([
47
+ "gpt-5.5",
48
+ "gpt-5.6-luna",
49
+ "gpt-5.6-sol",
50
+ "gpt-5.6-terra",
51
+ "gpt-6-astra",
52
+ "gpt-6-luna",
53
+ "gpt-6-sol",
54
+ "gpt-6.1-sol",
55
+ "gpt-6.1-terra",
56
+ "gpt-6.2-astra",
57
+ "gpt-6.2-sol",
58
+ ]),
59
+ ultrafast: new Set(["gpt-6.1-sol", "gpt-6.2-astra", "gpt-6.2-sol", "gpt-6-astra"]),
60
+ };
61
+
41
62
  // ── Helpers ──────────────────────────────────────────────────────────────────
42
63
 
43
64
  /** Replace $HOME with ~, mirroring Pi's built-in footer logic. */
@@ -615,11 +636,25 @@ export default function (pi: ExtensionAPI) {
615
636
  }
616
637
  saveSpeedTier();
617
638
  requestFooterRender();
618
- if (ctx.hasUI) {
639
+ if (!ctx.hasUI) return;
640
+ if (!speedTier) {
641
+ ctx.ui.notify(`${tier} mode off`, "info");
642
+ return;
643
+ }
644
+ const model = ctx.model;
645
+ if (!model || (model.provider !== "openai" && model.provider !== "openai-codex")) {
646
+ ctx.ui.notify(
647
+ `${speedTier} mode on — it only affects OpenAI requests; active model is ${model ? `${model.provider}/${model.id}` : "unset"}`,
648
+ "warning",
649
+ );
650
+ } else if (!SPEED_TIER_SUPPORT[tier].has(model.id)) {
651
+ ctx.ui.notify(
652
+ `${speedTier} mode on — ${model.id} is not on the known ${speedTier} support list; OpenAI may reject or ignore the request`,
653
+ "warning",
654
+ );
655
+ } else {
619
656
  ctx.ui.notify(
620
- speedTier
621
- ? `${speedTier} mode on — service_tier: ${speedTier === "fast" ? "priority" : "ultrafast"}`
622
- : `${tier} mode off`,
657
+ `${speedTier} mode on — service_tier: ${speedTier === "fast" ? "priority" : "ultrafast"}`,
623
658
  "info",
624
659
  );
625
660
  }