@hyperdreamer/pi-webui 1.10.7 → 1.11.0-beta.10

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.
Files changed (92) hide show
  1. package/README.md +17 -2
  2. package/dist/cli.js +265 -32
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/assets/{CodeViewer-BIb2Wx8W.js → CodeViewer-CAf_j27u.js} +1 -1
  5. package/dist/client/assets/{UnifiedDiffViewer-DpWiGlQo.js → UnifiedDiffViewer-wBjEJWa1.js} +1 -1
  6. package/dist/client/assets/{index-DX583DEv.js → index-5EtDb9nj.js} +1197 -476
  7. package/dist/client/index.html +1 -1
  8. package/dist/config.js +52 -11
  9. package/dist/config.js.map +1 -1
  10. package/dist/pi-webui-plugins/workspace-memory/pi-webui-plugin.js +3 -2
  11. package/dist/pi-webui-plugins/workspace-tasks/pi-webui-plugin.js +1 -0
  12. package/dist/plugin-api.d.ts +30 -0
  13. package/dist/server/app.js +6 -1
  14. package/dist/server/app.js.map +1 -1
  15. package/dist/server/realtime/sessionEventHub.js +40 -5
  16. package/dist/server/realtime/sessionEventHub.js.map +1 -1
  17. package/dist/server/realtime/sessionStatusCoalescer.js +137 -0
  18. package/dist/server/realtime/sessionStatusCoalescer.js.map +1 -0
  19. package/dist/server/sessiond/sessionProxyRoutes.js +2 -0
  20. package/dist/server/sessiond/sessionProxyRoutes.js.map +1 -1
  21. package/dist/server/sessiond.js +57 -5
  22. package/dist/server/sessiond.js.map +1 -1
  23. package/dist/server/sessions/modelPolicyCapability.js +88 -0
  24. package/dist/server/sessions/modelPolicyCapability.js.map +1 -0
  25. package/dist/server/sessions/modelPolicyTool.js +31 -0
  26. package/dist/server/sessions/modelPolicyTool.js.map +1 -0
  27. package/dist/server/sessions/modelTierRegistry.js +14 -0
  28. package/dist/server/sessions/modelTierRegistry.js.map +1 -1
  29. package/dist/server/sessions/modelTierSettingsRoutes.js +36 -0
  30. package/dist/server/sessions/modelTierSettingsRoutes.js.map +1 -0
  31. package/dist/server/sessions/modelTierSettingsService.js +100 -0
  32. package/dist/server/sessions/modelTierSettingsService.js.map +1 -0
  33. package/dist/server/sessions/piSessionService.js +1643 -433
  34. package/dist/server/sessions/piSessionService.js.map +1 -1
  35. package/dist/server/sessions/sessionDefaultsRoutes.js +39 -0
  36. package/dist/server/sessions/sessionDefaultsRoutes.js.map +1 -1
  37. package/dist/server/sessions/sessionDefaultsService.js +36 -6
  38. package/dist/server/sessions/sessionDefaultsService.js.map +1 -1
  39. package/dist/server/sessions/sessionMetadataStore.js +107 -13
  40. package/dist/server/sessions/sessionMetadataStore.js.map +1 -1
  41. package/dist/server/sessions/sessionModelPolicy.js +118 -0
  42. package/dist/server/sessions/sessionModelPolicy.js.map +1 -0
  43. package/dist/server/sessions/sessionReorder.js +117 -0
  44. package/dist/server/sessions/sessionReorder.js.map +1 -0
  45. package/dist/server/sessions/sessionRouteFastifyOptions.js +8 -0
  46. package/dist/server/sessions/sessionRouteFastifyOptions.js.map +1 -0
  47. package/dist/server/sessions/sessionRoutes.js +208 -3
  48. package/dist/server/sessions/sessionRoutes.js.map +1 -1
  49. package/dist/server/sessions/starterModelPolicyPreferenceStore.js +164 -0
  50. package/dist/server/sessions/starterModelPolicyPreferenceStore.js.map +1 -0
  51. package/dist/server/sessions/utilityModelExtension.js +199 -0
  52. package/dist/server/sessions/utilityModelExtension.js.map +1 -0
  53. package/dist/server/sessions/utilityModelResolver.js +77 -0
  54. package/dist/server/sessions/utilityModelResolver.js.map +1 -0
  55. package/dist/server/sessions/utilityModelSettingsRoutes.js +62 -0
  56. package/dist/server/sessions/utilityModelSettingsRoutes.js.map +1 -0
  57. package/dist/server/sessions/utilityModelSettingsService.js +101 -0
  58. package/dist/server/sessions/utilityModelSettingsService.js.map +1 -0
  59. package/dist/server/skills/optionalSkillInstall.js +69 -0
  60. package/dist/server/skills/optionalSkillInstall.js.map +1 -0
  61. package/dist/server/skills/optionalSkillInstaller.js +148 -0
  62. package/dist/server/skills/optionalSkillInstaller.js.map +1 -0
  63. package/dist/shared/apiTypes.d.ts +129 -3
  64. package/dist/shared/apiTypes.js +10 -0
  65. package/dist/shared/apiTypes.js.map +1 -1
  66. package/dist/shared/capabilities.js +15 -0
  67. package/dist/shared/capabilities.js.map +1 -1
  68. package/dist/shared/federatedRoutes.js +7 -0
  69. package/dist/shared/federatedRoutes.js.map +1 -1
  70. package/docs/assets/pi-webui-desktop.png +0 -0
  71. package/docs/config.md +61 -3
  72. package/docs/plugins.md +93 -16
  73. package/optional-skills/deterministic-subagent-driven-development/SKILL.md +224 -0
  74. package/optional-skills/deterministic-subagent-driven-development/pi-webui-skill.json +28 -0
  75. package/optional-skills/deterministic-subagent-driven-development/prompts/final-reviewer.md +132 -0
  76. package/optional-skills/deterministic-subagent-driven-development/prompts/implementer.md +101 -0
  77. package/optional-skills/deterministic-subagent-driven-development/prompts/re-reviewer.md +60 -0
  78. package/optional-skills/deterministic-subagent-driven-development/prompts/task-reviewer.md +80 -0
  79. package/optional-skills/deterministic-subagent-driven-development/references/capability-contract.md +174 -0
  80. package/optional-skills/deterministic-subagent-driven-development/references/plan-contract.md +268 -0
  81. package/optional-skills/deterministic-subagent-driven-development/references/state-machine.md +177 -0
  82. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/manifest.mjs +258 -0
  83. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/plan-policy.mjs +350 -0
  84. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/prompt-renderer.mjs +290 -0
  85. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/state-machine.mjs +1264 -0
  86. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/state-store.mjs +532 -0
  87. package/optional-skills/deterministic-subagent-driven-development/scripts/sdd-state +3 -0
  88. package/optional-skills/deterministic-subagent-driven-development/scripts/sdd-state.mjs +349 -0
  89. package/optional-skills/deterministic-writing-plans/SKILL.md +232 -0
  90. package/optional-skills/deterministic-writing-plans/references/grammar.md +84 -0
  91. package/optional-skills/deterministic-writing-plans/templates/plan-skeleton.md +143 -0
  92. package/package.json +13 -9
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Filesystem side of installing the opt-in skills.
3
+ *
4
+ * Every boundary is injected so the plan can be exercised without touching a
5
+ * real home directory. `installOptionalSkills` performs no I/O of its own beyond
6
+ * the injected operations, and reports what it did so the CLI can print a
7
+ * restore path.
8
+ */
9
+ import { OPTIONAL_SKILLS, pruneSkillLock, rewriteSkillNames, } from "./optionalSkillInstall.js";
10
+ /** Files whose bytes are rewritten during install. Anything else is copied verbatim. */
11
+ const REWRITABLE_EXTENSIONS = Object.freeze([".md", ".mjs", ".json"]);
12
+ /**
13
+ * Helper scripts the controller composes with but deliberately does not reimplement.
14
+ *
15
+ * `plan-contract.md` names `task-brief` and `review-package` as the writers of
16
+ * task briefs and review packages. They ship with the upstream skill, so replacing
17
+ * that skill without carrying them forward leaves the controller unable to produce
18
+ * those artifacts.
19
+ */
20
+ export const INHERITED_SCRIPTS = Object.freeze([
21
+ "sdd-workspace",
22
+ "task-brief",
23
+ "review-package",
24
+ ]);
25
+ /**
26
+ * Directories that exist only to develop the skills, never to run them.
27
+ *
28
+ * The published tarball already excludes these, but installing from a repository
29
+ * checkout would otherwise copy them into the user's skill directory, where they
30
+ * are dead weight and misleading.
31
+ */
32
+ const DEVELOPMENT_DIRECTORIES = Object.freeze(["evals/", "tests/"]);
33
+ function isDevelopmentOnly(relativePath) {
34
+ return DEVELOPMENT_DIRECTORIES.some((dir) => relativePath.startsWith(dir));
35
+ }
36
+ function joinPath(...parts) {
37
+ return parts.join("/");
38
+ }
39
+ function isRewritable(relativePath) {
40
+ return REWRITABLE_EXTENSIONS.some((extension) => relativePath.endsWith(extension));
41
+ }
42
+ /**
43
+ * Backs up, replaces, and rewrites the opt-in skills, then prunes stale lock entries.
44
+ *
45
+ * Ordering matters: the backup completes before anything is removed, so a failure
46
+ * mid-install leaves a recoverable copy. The manifest is regenerated last, after
47
+ * the rewrite, because the skill name lives inside hashed runtime files.
48
+ */
49
+ export function installOptionalSkills(io, request) {
50
+ const skills = request.skills ?? OPTIONAL_SKILLS;
51
+ const dryRun = request.dryRun ?? false;
52
+ const backedUp = [];
53
+ const installed = [];
54
+ for (const skill of skills) {
55
+ const sourceDir = joinPath(request.sourceRoot, skill.sourceName);
56
+ if (!io.exists(sourceDir)) {
57
+ throw new Error(`optional skill source is missing: ${sourceDir}. This build does not ship optional skills.`);
58
+ }
59
+ }
60
+ if (!dryRun)
61
+ io.makeDir(request.backupRoot);
62
+ for (const skill of skills) {
63
+ const target = joinPath(request.skillsRoot, skill.installName);
64
+ if (!io.exists(target))
65
+ continue;
66
+ backedUp.push(skill.installName);
67
+ if (dryRun)
68
+ continue;
69
+ io.movePath(target, joinPath(request.backupRoot, skill.installName));
70
+ }
71
+ if (io.exists(request.lockPath)) {
72
+ if (!dryRun)
73
+ io.copyFile(request.lockPath, joinPath(request.backupRoot, "skill-lock.json"));
74
+ backedUp.push("skill-lock.json");
75
+ }
76
+ for (const skill of skills) {
77
+ const sourceDir = joinPath(request.sourceRoot, skill.sourceName);
78
+ const targetDir = joinPath(request.skillsRoot, skill.installName);
79
+ installed.push(skill.installName);
80
+ if (dryRun)
81
+ continue;
82
+ for (const relativePath of io.listFiles(sourceDir)) {
83
+ if (isDevelopmentOnly(relativePath))
84
+ continue;
85
+ const from = joinPath(sourceDir, relativePath);
86
+ const to = joinPath(targetDir, relativePath);
87
+ const parent = to.slice(0, to.lastIndexOf("/"));
88
+ io.makeDir(parent);
89
+ // Rewrite against every known skill, not just the ones being installed: the
90
+ // authoring skill cites the controller's directory as a sibling path, so a
91
+ // partial install must still produce a resolvable reference.
92
+ if (isRewritable(relativePath))
93
+ io.writeFile(to, rewriteSkillNames(io.readFile(from)));
94
+ else
95
+ io.copyFile(from, to);
96
+ }
97
+ carryInheritedScripts(io, joinPath(request.backupRoot, skill.installName), targetDir);
98
+ io.regenerateManifest(targetDir);
99
+ }
100
+ const lockEntriesRemoved = pruneLock(io, request, skills, dryRun);
101
+ return {
102
+ backupRoot: request.backupRoot,
103
+ installed,
104
+ backedUp,
105
+ lockEntriesRemoved,
106
+ dryRun,
107
+ };
108
+ }
109
+ /**
110
+ * Copies inherited helper scripts from the backed-up skill into the new install.
111
+ *
112
+ * Silent when the previous skill did not have them: a fresh install alongside no
113
+ * upstream skill is legitimate, and the controller only needs them once a run
114
+ * reaches the brief or review stage.
115
+ */
116
+ function carryInheritedScripts(io, backupDir, targetDir) {
117
+ for (const script of INHERITED_SCRIPTS) {
118
+ const from = joinPath(backupDir, "scripts", script);
119
+ if (!io.exists(from))
120
+ continue;
121
+ io.copyFile(from, joinPath(targetDir, "scripts", script));
122
+ }
123
+ }
124
+ /** Narrows parsed JSON to the lock document shape without a type assertion. */
125
+ function isLockDocument(value) {
126
+ return typeof value === "object" && value !== null && !Array.isArray(value);
127
+ }
128
+ function pruneLock(io, request, skills, dryRun) {
129
+ if (!io.exists(request.lockPath))
130
+ return [];
131
+ let parsed;
132
+ try {
133
+ parsed = JSON.parse(io.readFile(request.lockPath));
134
+ }
135
+ catch {
136
+ throw new Error(`skill lock file is not valid JSON: ${request.lockPath}`);
137
+ }
138
+ if (!isLockDocument(parsed)) {
139
+ throw new Error(`skill lock file is not an object: ${request.lockPath}`);
140
+ }
141
+ const document = parsed;
142
+ const { document: pruned, removed } = pruneSkillLock(document, skills);
143
+ if (removed.length > 0 && !dryRun) {
144
+ io.writeFile(request.lockPath, `${JSON.stringify(pruned, null, 2)}\n`);
145
+ }
146
+ return removed;
147
+ }
148
+ //# sourceMappingURL=optionalSkillInstaller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionalSkillInstaller.js","sourceRoot":"","sources":["../../../src/server/skills/optionalSkillInstaller.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAMnC,wFAAwF;AACxF,MAAM,qBAAqB,GA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EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -16,6 +16,11 @@ export declare const PI_WEBUI_CAPABILITIES: {
16
16
  readonly piPackagesManage: "piPackages.manage";
17
17
  readonly selectedMachineSettings: "settings.selectedMachine";
18
18
  readonly agentProfileConfig: "settings.agentProfile";
19
+ readonly modelTierSettings: "settings.modelTiers";
20
+ readonly utilityModelSettings: "settings.utilityModels";
21
+ readonly sessionsModelPolicy: "sessions.modelPolicy";
22
+ readonly sessionsModelPolicyDefaults: "sessions.modelPolicyDefaults";
23
+ readonly sessionsReorder: "sessions.reorder";
19
24
  };
20
25
  export type PiWebUiCapability = typeof PI_WEBUI_CAPABILITIES[keyof typeof PI_WEBUI_CAPABILITIES];
21
26
  export interface Machine {
@@ -67,11 +72,88 @@ export interface TierModelRef {
67
72
  provider: string;
68
73
  id: string;
69
74
  }
75
+ export declare const UTILITY_MODEL_SLOTS: readonly ["lightweight", "context"];
76
+ export type UtilityModelSlot = (typeof UTILITY_MODEL_SLOTS)[number];
77
+ export interface UtilityModelSettings {
78
+ lightweight?: TierModelRef;
79
+ context?: TierModelRef;
80
+ }
81
+ export type UtilityModelSettingsUpdate = Partial<Record<UtilityModelSlot, TierModelRef | null>>;
82
+ export interface UtilityModelOption {
83
+ model: TierModelRef;
84
+ name?: string;
85
+ }
86
+ export interface UtilityModelSlotValidation {
87
+ valid: boolean;
88
+ reason?: string;
89
+ }
90
+ export interface UtilityModelSettingsResponse {
91
+ contractVersion: 1;
92
+ settings: UtilityModelSettings;
93
+ models: UtilityModelOption[];
94
+ slots: Record<UtilityModelSlot, UtilityModelSlotValidation>;
95
+ valid: boolean;
96
+ configError?: string;
97
+ }
70
98
  export interface ModelTierEntry {
71
99
  model: TierModelRef;
72
100
  thinkingLevel: string;
73
101
  }
74
102
  export type ModelTierLadder = Record<ModelTier, ModelTierEntry>;
103
+ export interface ModelTierModelOption {
104
+ model: TierModelRef;
105
+ name?: string;
106
+ thinkingLevels: string[];
107
+ }
108
+ export interface ExactModelSelection {
109
+ model: TierModelRef;
110
+ thinkingLevel: string;
111
+ }
112
+ export type SessionModelPolicyMode = "exact" | "tiered";
113
+ export interface StarterModelPolicyPreference {
114
+ mode: SessionModelPolicyMode;
115
+ /** Remembered while Exact is active; required while Tiered is active. */
116
+ tier?: ModelTier;
117
+ }
118
+ export interface SessionModelPolicy {
119
+ mode: SessionModelPolicyMode;
120
+ exact: ExactModelSelection;
121
+ /** Remembered after the first Tiered choice, including while Exact is active. */
122
+ tier?: ModelTier;
123
+ }
124
+ export type SessionModelPolicyUpdate = {
125
+ mode: "exact";
126
+ exact: ExactModelSelection;
127
+ } | {
128
+ mode: "tiered";
129
+ tier: ModelTier;
130
+ };
131
+ export interface ClientSessionModelPolicyStatus {
132
+ mode: SessionModelPolicyMode;
133
+ tier?: ModelTier;
134
+ /** The tuple last confirmed by the policy runtime adapter in this staged slice. */
135
+ resolved: ExactModelSelection;
136
+ ladderValid: boolean;
137
+ blockedReason?: string;
138
+ }
139
+ export interface SessionModelPolicyResponse {
140
+ contractVersion: 1;
141
+ /** Omitted only when the newest persisted entry is malformed and requires repair. */
142
+ policy?: SessionModelPolicy;
143
+ session: SessionStatus;
144
+ }
145
+ export interface ModelTierRowValidation {
146
+ valid: boolean;
147
+ reason?: string;
148
+ }
149
+ export interface ModelTierSettingsResponse {
150
+ contractVersion: 1;
151
+ ladder?: ModelTierLadder;
152
+ models: ModelTierModelOption[];
153
+ rows: Record<ModelTier, ModelTierRowValidation>;
154
+ valid: boolean;
155
+ configError?: string;
156
+ }
75
157
  export interface PiWebUiAgentConfig {
76
158
  /** Pi-compatible companion CLI used for diagnostics and safe package-managed updates. */
77
159
  command?: string;
@@ -92,6 +174,8 @@ export interface PiWebUiConfigValues {
92
174
  maxUploadBytes?: number;
93
175
  /** Machine-global exact model and thinking bindings for the six canonical tiers. */
94
176
  modelTiers?: ModelTierLadder;
177
+ /** Machine-global model bindings for utility operations outside active sessions. */
178
+ utilityModels?: UtilityModelSettings;
95
179
  /** When true, LLMs can start new sessions via the spawn_session tool. */
96
180
  spawnSessions?: boolean;
97
181
  /**
@@ -320,6 +404,31 @@ export interface SessionRef {
320
404
  id: string;
321
405
  cwd: string;
322
406
  }
407
+ /** Identifies the sibling group a persisted manual order position belongs to. */
408
+ export type SessionReorderScope = {
409
+ kind: "root";
410
+ cwd: string;
411
+ } | {
412
+ kind: "children";
413
+ parentSessionPath: string;
414
+ };
415
+ export declare const SESSION_REORDER_LIMIT = 1000;
416
+ export declare const SESSION_REORDER_SESSION_ID_MAX_LENGTH = 512;
417
+ export declare const SESSION_REORDER_CWD_MAX_LENGTH: number;
418
+ export declare const SESSION_REORDER_PARENT_PATH_MAX_LENGTH: number;
419
+ export interface SessionReorderRequest {
420
+ cwd: string;
421
+ scope: SessionReorderScope;
422
+ pinned: boolean;
423
+ catalogCwds: string[];
424
+ orderedSessions: SessionRef[];
425
+ }
426
+ export interface SessionOrderEntry extends SessionRef {
427
+ manualOrder: number;
428
+ }
429
+ export interface SessionReorderResponse {
430
+ orderedSessions: SessionOrderEntry[];
431
+ }
323
432
  export declare const SESSION_UNREAD_LIMIT = 1000;
324
433
  export declare const SESSION_UNREAD_SESSION_ID_MAX_LENGTH = 512;
325
434
  export declare const SESSION_UNREAD_CWD_MAX_LENGTH: number;
@@ -444,6 +553,8 @@ export interface SessionInfo extends SessionRef {
444
553
  archivedAt?: string;
445
554
  /** True when the user has pinned this session so it sorts first in lists. */
446
555
  pinned?: boolean;
556
+ /** Normalized durable position inside this session's sibling and pin group. */
557
+ manualOrder?: number;
447
558
  }
448
559
  export interface ArchiveSessionsResponse {
449
560
  archived: true;
@@ -628,14 +739,28 @@ export interface SessionDefaultsResponse {
628
739
  thinkingLevel: string;
629
740
  models: SessionModel[];
630
741
  thinkingLevels: string[];
742
+ starterModelPolicyPreference?: StarterModelPolicyPreference;
743
+ starterModelPolicyPreferenceError?: string;
631
744
  }
632
- export interface SessionDefaultsUpdate {
633
- model?: {
745
+ export type SessionDefaultsUpdate = {
746
+ model: {
634
747
  provider: string;
635
748
  modelId: string;
636
749
  };
637
750
  thinkingLevel?: string;
638
- }
751
+ starterModelPolicyPreference?: never;
752
+ } | {
753
+ model?: {
754
+ provider: string;
755
+ modelId: string;
756
+ };
757
+ thinkingLevel: string;
758
+ starterModelPolicyPreference?: never;
759
+ } | {
760
+ model?: never;
761
+ thinkingLevel?: never;
762
+ starterModelPolicyPreference: StarterModelPolicyPreference;
763
+ };
639
764
  /** Editable `models.json` document for the active Pi-compatible profile. */
640
765
  export interface ModelsConfigDocument {
641
766
  providers?: Record<string, ModelsConfigProvider> | undefined;
@@ -736,6 +861,7 @@ export interface SessionStatus {
736
861
  persisted?: boolean;
737
862
  model?: SessionModel;
738
863
  thinkingLevel?: string;
864
+ modelPolicy?: ClientSessionModelPolicyStatus;
739
865
  isStreaming: boolean;
740
866
  isCompacting: boolean;
741
867
  isBashRunning: boolean;
@@ -14,8 +14,18 @@ export const PI_WEBUI_CAPABILITIES = {
14
14
  piPackagesManage: "piPackages.manage",
15
15
  selectedMachineSettings: "settings.selectedMachine",
16
16
  agentProfileConfig: "settings.agentProfile",
17
+ modelTierSettings: "settings.modelTiers",
18
+ utilityModelSettings: "settings.utilityModels",
19
+ sessionsModelPolicy: "sessions.modelPolicy",
20
+ sessionsModelPolicyDefaults: "sessions.modelPolicyDefaults",
21
+ sessionsReorder: "sessions.reorder",
17
22
  };
18
23
  export const MODEL_TIERS = ["economy", "fast", "standard", "advanced", "capable", "frontier"];
24
+ export const UTILITY_MODEL_SLOTS = ["lightweight", "context"];
25
+ export const SESSION_REORDER_LIMIT = 1_000;
26
+ export const SESSION_REORDER_SESSION_ID_MAX_LENGTH = 512;
27
+ export const SESSION_REORDER_CWD_MAX_LENGTH = 32 * 1024;
28
+ export const SESSION_REORDER_PARENT_PATH_MAX_LENGTH = 32 * 1024;
19
29
  export const SESSION_UNREAD_LIMIT = 1_000;
20
30
  export const SESSION_UNREAD_SESSION_ID_MAX_LENGTH = 512;
21
31
  export const SESSION_UNREAD_CWD_MAX_LENGTH = 32 * 1024;
@@ -1 +1 @@
1
- {"version":3,"file":"apiTypes.js","sourceRoot":"","sources":["../../src/shared/apiTypes.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,eAAe,EAAE,kBAAkB;IACnC,cAAc,EAAE,iBAAiB;IACjC,kBAAkB,EAAE,qBAAqB;IACzC,sBAAsB,EAAE,yBAAyB;IACjD,oBAAoB,EAAE,uBAAuB;IAC7C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,cAAc,EAAE,iBAAiB;IACjC,iBAAiB,EAAE,oBAAoB;IACvC,wBAAwB,EAAE,2BAA2B;IACrD,gBAAgB,EAAE,mBAAmB;IACrC,uBAAuB,EAAE,0BAA0B;IACnD,kBAAkB,EAAE,uBAAuB;CACnC,CAAC;AAsDX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAkTvG,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,GAAG,IAAI,CAAC;AACvD,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,CAAC;AAqCzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAC9C,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,GAAG,IAAI,CAAC;AAmuB3D,M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C1C,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,GAAG,IAAI,CAAC;AACvD,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,CAAC;AAqCzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAC9C,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,GAAG,IAAI,CAAC;AAovB3D,MAAM,CAAC,MAAM,2CAA2C,GAAG,MAAM,CAAC"}
@@ -18,6 +18,11 @@ export const WEB_RUNTIME_CAPABILITIES = [
18
18
  PI_WEBUI_CAPABILITIES.piPackagesManage,
19
19
  PI_WEBUI_CAPABILITIES.selectedMachineSettings,
20
20
  PI_WEBUI_CAPABILITIES.agentProfileConfig,
21
+ PI_WEBUI_CAPABILITIES.modelTierSettings,
22
+ PI_WEBUI_CAPABILITIES.utilityModelSettings,
23
+ PI_WEBUI_CAPABILITIES.sessionsModelPolicy,
24
+ PI_WEBUI_CAPABILITIES.sessionsModelPolicyDefaults,
25
+ PI_WEBUI_CAPABILITIES.sessionsReorder,
21
26
  ];
22
27
  export const SESSIOND_RUNTIME_CAPABILITIES = [
23
28
  PI_WEBUI_CAPABILITIES.sessionsDeleteArchived,
@@ -31,6 +36,11 @@ export const SESSIOND_RUNTIME_CAPABILITIES = [
31
36
  PI_WEBUI_CAPABILITIES.sessionsNotifications,
32
37
  PI_WEBUI_CAPABILITIES.sessionsUnread,
33
38
  PI_WEBUI_CAPABILITIES.promptAttachments,
39
+ PI_WEBUI_CAPABILITIES.modelTierSettings,
40
+ PI_WEBUI_CAPABILITIES.utilityModelSettings,
41
+ PI_WEBUI_CAPABILITIES.sessionsModelPolicy,
42
+ PI_WEBUI_CAPABILITIES.sessionsModelPolicyDefaults,
43
+ PI_WEBUI_CAPABILITIES.sessionsReorder,
34
44
  ];
35
45
  const EFFECTIVE_CAPABILITY_REQUIREMENTS = {
36
46
  [PI_WEBUI_CAPABILITIES.sessionsDeleteArchived]: ["web", "sessiond"],
@@ -48,6 +58,11 @@ const EFFECTIVE_CAPABILITY_REQUIREMENTS = {
48
58
  [PI_WEBUI_CAPABILITIES.piPackagesManage]: ["web"],
49
59
  [PI_WEBUI_CAPABILITIES.selectedMachineSettings]: ["web"],
50
60
  [PI_WEBUI_CAPABILITIES.agentProfileConfig]: ["web"],
61
+ [PI_WEBUI_CAPABILITIES.modelTierSettings]: ["web", "sessiond"],
62
+ [PI_WEBUI_CAPABILITIES.utilityModelSettings]: ["web", "sessiond"],
63
+ [PI_WEBUI_CAPABILITIES.sessionsModelPolicy]: ["web", "sessiond"],
64
+ [PI_WEBUI_CAPABILITIES.sessionsModelPolicyDefaults]: ["web", "sessiond"],
65
+ [PI_WEBUI_CAPABILITIES.sessionsReorder]: ["web", "sessiond"],
51
66
  };
52
67
  export function isPiWebUiCapability(value) {
53
68
  return typeof value === "string" && knownPiWebUiCapabilities.has(value);
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/shared/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAsF,MAAM,eAAe,CAAC;AAE1I,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAGjC,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAChF,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,qBAAqB,CAAC,sBAAsB;IAC5C,qBAAqB,CAAC,qBAAqB;IAC3C,qBAAqB,CAAC,eAAe;IACrC,qBAAqB,CAAC,cAAc;IACpC,qBAAqB,CAAC,kBAAkB;IACxC,qBAAqB,CAAC,sBAAsB;IAC5C,qBAAqB,CAAC,oBAAoB;IAC1C,qBAAqB,CAAC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EAAE,CAAC,OAAO,UAAU,KAAK,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5G,OAAO,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,UAAiH;IAC5J,OAAO,2BAA2B,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE;QACvD,MAAM,kBAAkB,GAAG,iCAAiC,CAAC,UAAU,CAAC,CAAC;QACzE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;YACtC,OAAO,OAAO,EAAE,SAAS,KAAK,IAAI,IAAI,yBAAyB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -14,6 +14,10 @@ export const FEDERATED_HTTP_ROUTES = [
14
14
  { method: "POST", path: "/models-config/discover" },
15
15
  { method: "GET", path: "/session-defaults" },
16
16
  { method: "PUT", path: "/session-defaults" },
17
+ { method: "GET", path: "/model-tiers" },
18
+ { method: "PUT", path: "/model-tiers" },
19
+ { method: "GET", path: "/utility-models" },
20
+ { method: "PUT", path: "/utility-models" },
17
21
  { method: "GET", path: "/agent-memory/snapshot" },
18
22
  { method: "GET", path: "/skills" },
19
23
  { method: "PATCH", path: "/skills" },
@@ -72,6 +76,8 @@ export const FEDERATED_HTTP_ROUTES = [
72
76
  { method: "GET", path: "/sessions/:sessionId/system-prompt" },
73
77
  { method: "GET", path: "/sessions/:sessionId/stream-snapshot" },
74
78
  { method: "GET", path: "/sessions/:sessionId/models" },
79
+ { method: "GET", path: "/sessions/:sessionId/model-policy" },
80
+ { method: "PUT", path: "/sessions/:sessionId/model-policy" },
75
81
  { method: "POST", path: "/sessions/:sessionId/model" },
76
82
  { method: "POST", path: "/sessions/:sessionId/model/cycle" },
77
83
  { method: "GET", path: "/sessions/:sessionId/thinking-levels" },
@@ -95,6 +101,7 @@ export const FEDERATED_HTTP_ROUTES = [
95
101
  { method: "POST", path: "/sessions/:sessionId/restore" },
96
102
  { method: "DELETE", path: "/sessions/:sessionId" },
97
103
  { method: "POST", path: "/sessions/:sessionId/reload" },
104
+ { method: "POST", path: "/sessions/:sessionId/reorder" },
98
105
  { method: "POST", path: "/sessions/:sessionId/detach-parent" },
99
106
  { method: "GET", path: "/auth/providers" },
100
107
  { method: "POST", path: "/auth/api-key" },
@@ -1 +1 @@
1
- {"version":3,"file":"federatedRoutes.js","sourceRoot":"","sources":["../../src/shared/federatedRoutes.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC/D,MAAM,CAAC,MAAM,6CAA6C,GAAG,CAAC,GAAG,MAAM,CAAC;AACxE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC5D,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,GAAG,MAAM,CAAC;AAQnE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAC3C,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,EAAE;IAChD,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,0BAA0B,EAAE;IACnD,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;IAClC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE;IAClC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACzC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACzC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC/C,EAAE,MAAM,E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AM,EAAE,IAAI,EAAE,6BAA6B,EAAE;IACvD,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,EAAE;CACF,CAAC;AAEvD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS;IACT,kBAAkB;IAClB,6BAA6B;IAC7B,2EAA2E;CACvC,CAAC"}
Binary file
package/docs/config.md CHANGED
@@ -11,7 +11,7 @@ PI WEBUI uses two config files:
11
11
  - **Global PI WEBUI config:** `$PI_WEBUI_CONFIG`, or `$XDG_CONFIG_HOME/pi-webui/config.json`, or `~/.config/pi-webui/config.json`.
12
12
  - **Project-local PI WEBUI config:** `<project>/.pi-webui/config.json` for commit-able project settings.
13
13
 
14
- Each PI WEBUI machine has its own config. When using Fleet/machine federation, Settings uses the selected machine for config that affects work running there: the Pi-compatible agent profile and companion CLI, session daemon tools, PI WEBUI plugin enablement, external path access, and upload defaults. Gateway/browser-only settings stay local to the gateway: keyboard shortcuts, remote machine registry/tokens, and gateway host/port/allowed-hosts. Remote servers that do not advertise selected-machine settings support report those settings as unavailable instead of silently falling back to the gateway.
14
+ Each PI WEBUI machine has its own config. When using Fleet/machine federation, Settings uses the selected machine for config that affects work running there: the Pi-compatible agent profile and companion CLI, session daemon tools, model tier routing ladder, utility model routing, PI WEBUI plugin enablement, external path access, and upload defaults. Gateway/browser-only settings stay local to the gateway: keyboard shortcuts, remote machine registry/tokens, and gateway host/port/allowed-hosts. Remote servers that do not advertise selected-machine settings support report those settings as unavailable instead of silently falling back to the gateway.
15
15
 
16
16
  Pi package settings are separate from PI WEBUI config. They live in Pi's package-manager settings on the target machine and are managed by Pi (`pi install`, `pi remove`, `pi update`) or **Settings → Pi packages**. In a federated setup, **Settings → Pi packages** targets the currently selected machine. The PI WEBUI `plugins` config key only enables or disables discovered PI WEBUI browser plugins on the machine whose config you are editing; it does not install, remove, or update Pi packages.
17
17
 
@@ -40,6 +40,8 @@ Process restarts depend on the key:
40
40
  - `host` / `port`: restart the gateway web/API service or process.
41
41
  - `maxUploadBytes`: restart both the web/API process and the session daemon on that machine.
42
42
  - `agent.command` / `agent.dir` / `spawnSessions` / `subsessions`: restart the session daemon on that machine.
43
+ - `modelTiers`: saved settings apply immediately in **Settings → Model tiers**; validates all six ladder rows atomically.
44
+ - `utilityModels`: saved settings apply immediately in **Settings → Utility models**; existing sessions use updated values on their next utility operation.
43
45
  - `pathAccess`: applies on the next request; existing file views may need a browser refresh.
44
46
  - `uploads.defaultFolder`: applies to newly opened Files upload dialogs and new direct drag/drop batches after config/workspace refresh.
45
47
  - `plugins`: reload the browser tab after changing PI WEBUI plugin enablement.
@@ -63,6 +65,18 @@ Process restarts depend on the key:
63
65
  "command": "pi",
64
66
  "dir": "~/agent-profiles/research"
65
67
  },
68
+ "modelTiers": {
69
+ "economy": { "provider": "anthropic", "modelId": "claude-3-5-haiku-20241022", "thinkingLevel": "off" },
70
+ "fast": { "provider": "anthropic", "modelId": "claude-3-5-haiku-20241022", "thinkingLevel": "off" },
71
+ "standard": { "provider": "anthropic", "modelId": "claude-3-5-sonnet-20241022", "thinkingLevel": "off" },
72
+ "advanced": { "provider": "openai", "modelId": "gpt-4o", "thinkingLevel": "off" },
73
+ "capable": { "provider": "anthropic", "modelId": "claude-3-7-sonnet-20250219", "thinkingLevel": "high" },
74
+ "frontier": { "provider": "openai", "modelId": "o3-mini", "thinkingLevel": "high" }
75
+ },
76
+ "utilityModels": {
77
+ "lightweight": { "provider": "anthropic", "id": "claude-haiku" },
78
+ "context": { "provider": "anthropic", "id": "claude-sonnet" }
79
+ },
66
80
  "spawnSessions": true,
67
81
  "subsessions": false,
68
82
  "plugins": {
@@ -101,7 +115,7 @@ Plugins may own separate project files, such as `.pi-webui/tasks.json` for the b
101
115
 
102
116
  ## Configuration matrix
103
117
 
104
- Rows with JSON key `—` are runtime-only environment variables, not config-file keys. `Global` means machine-global. In Settings, selected-machine-safe global keys (`pathAccess`, `uploads`, `maxUploadBytes`, `agent`, `spawnSessions`, `subsessions`, and `plugins`) are edited for the selected machine; gateway host/port/allowed-hosts, keyboard shortcuts, and machine registry/tokens stay local.
118
+ Rows with JSON key `—` are runtime-only environment variables, not config-file keys. `Global` means machine-global. In Settings, selected-machine-safe global keys (`pathAccess`, `uploads`, `maxUploadBytes`, `agent`, `spawnSessions`, `subsessions`, `modelTiers`, `utilityModels`, and `plugins`) are edited for the selected machine; gateway host/port/allowed-hosts, keyboard shortcuts, and machine registry/tokens stay local.
105
119
 
106
120
  | Config | JSON key | Env var | Scope | Project-local behavior | Applies / restart |
107
121
  | --- | --- | --- | --- | --- | --- |
@@ -116,6 +130,8 @@ Rows with JSON key `—` are runtime-only environment variables, not config-file
116
130
  | Agent profile state directory | `agent.dir` | `PI_WEBUI_AGENT_DIR` (`PI_CODING_AGENT_DIR` for Pi compatibility) | Global/session daemon | Not supported locally | Restart session daemon on that machine; affects auth, models, settings, sessions, Pi packages, and package-backed plugins |
117
131
  | Agent can spawn sessions | `spawnSessions` | `PI_WEBUI_SPAWN_SESSIONS` | Global/session daemon | Not supported locally | Restart session daemon on that machine |
118
132
  | Tracked subsessions (beta) | `subsessions` | `PI_WEBUI_SUBSESSIONS` | Global/session daemon | Not supported locally; also requires `spawnSessions` | Restart session daemon on that machine |
133
+ | Model tier routing ladder | `modelTiers` | — | Global | Not supported locally | Saved settings apply immediately on save; requires remote peer capability `settings.modelTiers` |
134
+ | Utility model routing | `utilityModels` | — | Global | Not supported locally | Saved settings apply immediately on the next utility operation; requires remote peer capability `settings.utilityModels` |
119
135
  | Plugin enablement/settings | `plugins.<id>.enabled`, `plugins.<id>.settings` | — | Global | Not core local config; plugins may read their own project files | Reload browser tab |
120
136
  | Keyboard shortcuts | `shortcuts.<actionId>` | — | Global | Not supported locally | Applies after settings save/config refresh |
121
137
  | Project config version | `version` | — | Project | Project-local only; must be `1` when present | Next project-config read |
@@ -136,7 +152,9 @@ Rows with JSON key `—` are runtime-only environment variables, not config-file
136
152
 
137
153
  ### Managed data directory
138
154
 
139
- `PI_WEBUI_DATA_DIR` sets the root for PI WEBUI-managed runtime state and defaults to `~/.pi-webui`. Unless a more specific path override is configured, PI WEBUI stores its project and machine registries, locally discovered plugins, default session-daemon socket, and session archives beneath this root.
155
+ `PI_WEBUI_DATA_DIR` sets the root for PI WEBUI-managed runtime state and defaults to `~/.pi-webui`. Unless a more specific path override is configured, PI WEBUI stores its project and machine registries (`projects.json` and `machines.json`), remembered starter model policy preferences (`starter-model-policy-preferences.json`, see [Model tiers](#model-tiers)), locally discovered plugins, default session-daemon socket, and session archives beneath this root.
156
+
157
+ This managed state is not the user-editable config API. Edit it through PI WEBUI rather than by hand.
140
158
 
141
159
  This setting does not change the PI WEBUI config file selected by `PI_WEBUI_CONFIG` or Pi-owned state such as the active session files selected by `PI_CODING_AGENT_SESSION_DIR`.
142
160
 
@@ -212,6 +230,46 @@ The navigation footer exposes **Models** for the selected machine and **Skills**
212
230
 
213
231
  **Skills** lists the skills available to the selected workspace. It can toggle the `disable-model-invocation` frontmatter setting in a `SKILL.md`, search skills.sh, and install or update skills at global or project scope. Review third-party skill sources before installing them. After changing, installing, or updating a skill, use `/reload` in each idle session that should pick up the changed resource.
214
232
 
233
+ ### Utility models
234
+
235
+ `utilityModels` is a machine-global setting stored in `$PI_WEBUI_CONFIG` or `~/.config/pi-webui/config.json`. In **Settings → Utility models**, configure models for utility work on the selected machine. This is separate from **Settings → Model tiers**, which controls session model routing.
236
+
237
+ - `lightweight` handles automatic titles and requested branch summaries.
238
+ - `context` handles compaction.
239
+ - Title generation and branch summaries try `lightweight`, then the active session model.
240
+ - Compaction tries `context`, then `lightweight`, then the active session model.
241
+ - When both settings are unset, existing active-session behavior is preserved. An unset, malformed, unavailable, unauthenticated, authentication-failing, or call-failing candidate advances to the next fallback in its order.
242
+ - Utility calls never change the selected session model, its thinking level, or Pi's remembered default.
243
+ - Settings target the selected machine. Existing sessions read saved changes on their next utility operation; remote editing requires the additive `settings.utilityModels` capability.
244
+
245
+ ### Model tiers
246
+
247
+ `modelTiers` is a machine-global setting stored in `$PI_WEBUI_CONFIG` or `~/.config/pi-webui/config.json` that configures tier-based model routing for sessions.
248
+
249
+ In **Settings → Model tiers**, you edit one complete six-rung ladder: `economy`, `fast`, `standard`, `advanced`, `capable`, and `frontier`.
250
+
251
+ - **Row configuration:** Each row selects an authenticated model available on that machine (provider and model ID) and a supported thinking level (such as `off`, `low`, `medium`, `high`, or `max`).
252
+ - **Duplicate tuples:** Selecting the same model and thinking level tuple in multiple tiers is valid (for example, using the same fallback model across `economy` and `fast`).
253
+ - **Stale models:** If a configured model or provider is no longer in the authenticated model catalog, it remains visible as a stale entry in the ladder editor and must be explicitly repaired before saving.
254
+ - **Atomic validation:** Save validates all six rows atomically against the authenticated model catalog. Invalid or incomplete ladder configurations are rejected without silent clamping or fallback.
255
+ - **Missing or malformed ladder:** If `modelTiers` is missing or malformed, Exact-mode model selection remains fully usable, but tiered model routing becomes unavailable.
256
+ - **Machine federation:** Model tier settings are saved for the selected machine. Editing remote machine settings requires a remote daemon advertising the additive `settings.modelTiers` capability.
257
+
258
+ Sessions can also use a per-session model policy from the composer:
259
+
260
+ - **Composer controls:** The composer action row has three cascading controls: a mode pill, a mode-dependent second control, and an Exact-only thinking menu. The mode pill opens a two-item mode menu: **Exact model** with the hint "Choose a model and thinking level", and **Tiered** with the hint "Use a configured model tier". A checkmark marks the current mode. There is no policy panel or Save button.
261
+ - **Exact fallback:** With no remembered starter preference, a new root starts in Exact mode using Pi's persisted model and thinking defaults. Selecting Exact remembers the mode while retaining the last selected tier for a later switch back.
262
+ - **Exact controls:** The second control is the searchable model picker, and the third is a thinking level menu whose trigger is a bar gauge showing the current level's rank, with the level name in its tooltip. The menu lists levels relevant to the selected model in canonical ascending order: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. A level the model does not support stays visible but dimmed, says `unsupported by this model`, and cannot be selected. An Exact change applies once both a model and a supported thinking level are selected.
263
+ - **Remembered starter policy:** A valid starter mode and tier are remembered per workspace on the selected machine. Starter selections update this personal managed state immediately; changes inside an existing session do not change future-session defaults.
264
+ - **Tiered:** In Tiered mode, the second control is a tier menu listing all six ladder tiers. An unusable tier stays visible with its specific reason inline instead of being hidden, and selecting a valid tier applies immediately. No thinking control renders in Tiered mode; it is absent rather than disabled. Switching modes is non-destructive in both directions: the remembered tier and the remembered Exact model/thinking selection stay intact.
265
+ - **Validation and recovery:** A remembered Tiered choice whose current mapping is unavailable remains selected and blocks Start until the user chooses a valid tier, switches to a complete Exact branch, or repairs the ladder. PI WEBUI never substitutes another tier or Exact mode. A refused Start reports its reason without closing the new-session screen, and the reason is shown whether or not a session is currently selected in that workspace. The message follows the current reason and disappears once the block is repaired.
266
+ - **Persistence failures:** If PI WEBUI cannot read the preference, a complete Exact starter remains usable and the composer shows the preference error. If a write fails, the current session still starts with the selected in-memory policy but PI WEBUI warns that the choice was not remembered.
267
+ - **When changes are available:** You can change a policy only while its session is idle and writable. During active work and for archived sessions, the current policy and any block reason remain visible but the controls are disabled. Once the session is idle and writable, a blocked policy remains repairable through an explicit update.
268
+ - **Availability and compatibility:** Per-session policy uses `sessions.modelPolicy`; persisted starter mode/tier additionally requires `sessions.modelPolicyDefaults` on both web and session daemon. Older peers keep the previous in-memory starter behavior.
269
+ - **Managed state and concurrency:** Preferences live in `$PI_WEBUI_DATA_DIR/starter-model-policy-preferences.json` on the selected machine. One daemon serializes complete read-modify-write operations; atomic file replacement prevents partial JSON. Concurrent tabs therefore use last-successful-write-wins semantics in daemon queue order, not browser click order or cross-process locking.
270
+ - **Starting and persistence:** The selected policy is carried into root-session creation from both the first-prompt and **New Session** paths, persists with that session, and remains selected after a failed creation so a retry uses the same choice.
271
+ - **Scope and installation:** This release does not add `/tier-*` commands, and editing the tier ladder later does not automatically remap an existing Tiered session. After installing this release, restart `pi-webui-sessiond.service` manually once; ordinary UI/API autoreload does not load session-daemon changes.
272
+
215
273
  ### Session daemon tools
216
274
 
217
275
  `spawnSessions` controls whether agents receive the `spawn_session` tool. It defaults to `true`; set it to `false` if you do not want an agent to start independent PI WEBUI sessions.