@jwilger/pi-development-system 0.14.0 → 0.15.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jwilger/pi-development-system",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "A pi extension package representing a seasoned approach to software development using a full AI SDLC.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -16,7 +16,7 @@ export type Settings = {
16
16
  readonly thinkingLevel: ThinkingLevel;
17
17
  };
18
18
 
19
- const MODEL_REF = /^[^\s/]+\/\S+$/;
19
+ const MODEL_REF = /^[^\s/*]+\/[^\s*]+$/;
20
20
 
21
21
  const isLevel = (value: unknown): value is ThinkingLevel =>
22
22
  THINKING_LEVELS.some((level) => level === value);
@@ -66,7 +66,7 @@ export type ModelSource = "current" | "preferences" | "restored" | "inherited";
66
66
  * thread keeps the model it was already running instead of falling back to the preferences.
67
67
  */
68
68
  export function modelSource(input: {
69
- mode: "use-current" | "pick-first-scoped" | "pick-first";
69
+ mode: "use-current" | "pick-first-scoped" | "pick-first-available";
70
70
  pinned: boolean;
71
71
  hasPreferences: boolean;
72
72
  hasRestored: boolean;
@@ -38,3 +38,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
38
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39
39
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40
40
  SOFTWARE.
41
+ 6. Empty scope (I5 review): `orch/runtime.ts` `availableScopedModels` treats an empty `/scoped-models` as no restriction (pi's meaning) instead of "matches nothing", because every devsys agent declares `models:` and would otherwise be unspawnable by default. Pinned models are also re-applied on resume (`resolveInitialSettings`), since a restored session may hold only inherited history.
@@ -165,6 +165,8 @@ export function createDriverFactory(
165
165
  .map((model) => ({ model }));
166
166
  const availableScopedModels = (scopedModels: readonly ScopedModel[]) => {
167
167
  const available = new Set(availableModelCandidates().map(({ model }) => modelIdentity(model)));
168
+ // devsys: an empty scope means no /scoped-models restriction in pi, not "matches nothing".
169
+ if (scopedModels.length === 0) return [...availableModelCandidates()];
168
170
  return scopedModels.filter(({ model }) => available.has(modelIdentity(model)));
169
171
  };
170
172
  const selectTypeModelPreference = (
@@ -232,9 +234,12 @@ export function createDriverFactory(
232
234
  : undefined;
233
235
  const thinkingLevel =
234
236
  savedThinking ?? type.thinkingLevel ?? parent?.thinking ?? ctx.thinkingLevel ?? "off";
235
- // devsys: a per-spawn pin from agent_spawn wins; restored sessions already persist their choice.
236
- if (restored === undefined)
237
- return applySpawnOverrides({ provider, id, thinkingLevel }, type.spawnOverrides);
237
+ // devsys: a per-spawn pin from agent_spawn wins. On resume the thinking level is the saved one,
238
+ // but the pinned model still applies: the restored session may only hold inherited history.
239
+ const pins = type.spawnOverrides;
240
+ if (restored === undefined) return applySpawnOverrides({ provider, id, thinkingLevel }, pins);
241
+ if (pins?.model !== undefined)
242
+ return applySpawnOverrides({ provider, id, thinkingLevel }, { model: pins.model });
238
243
  return { provider, id, thinkingLevel };
239
244
  };
240
245
  const resolveAgentSettings = (type: AgentType, parentPath: string): ResolvedAgentSettings => {