larkin 0.2.84 → 0.2.86

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.
@@ -9,6 +9,7 @@ import { internalCommandSpec } from "../app/internal-command.mjs";
9
9
  import { piAgentDirectory } from "./pi-provider-config.mjs";
10
10
  import { resolvePiSubagentExtensionArg } from "./pi-subagent-injection.mjs";
11
11
  import { resolvePiBashTimeoutExtensionArg } from "./pi-bash-timeout-injection.mjs";
12
+ import { isWindows } from "../platform/secure-metadata.mjs";
12
13
  import { classifyRuntimePrerequisite, probeNativeRuntimeReadiness, providerAuthenticationFailureReadiness, RuntimePrerequisiteError, } from "./runtime-readiness.mjs";
13
14
  class EventSession {
14
15
  listeners = new Set();
@@ -820,7 +821,7 @@ async function createPiRpcBackend(input, dependencies, spawn) {
820
821
  mergedEnv.PI_CODING_AGENT_DIR = piAgentDirectory(mergedEnv.LARKIN_CONFIG_DIR, input.agentId);
821
822
  mergedEnv.PI_TELEMETRY = "0";
822
823
  }
823
- const subagentExtension = resolvePiSubagentExtensionArg({
824
+ const subagentExtension = builtin && isWindows ? null : resolvePiSubagentExtensionArg({
824
825
  distribution: builtin ? "builtin" : "external",
825
826
  piCommand: command,
826
827
  env: mergedEnv,
@@ -828,7 +829,7 @@ async function createPiRpcBackend(input, dependencies, spawn) {
828
829
  if (subagentExtension)
829
830
  commandArgs.push("-e", subagentExtension);
830
831
  // bash 60s 超时护栏(issue #55/#56):与 pi-subagents 一起注入,两者工具名不冲突。
831
- const bashTimeoutExtension = resolvePiBashTimeoutExtensionArg({
832
+ const bashTimeoutExtension = builtin && isWindows ? null : resolvePiBashTimeoutExtensionArg({
832
833
  distribution: builtin ? "builtin" : "external",
833
834
  piCommand: command,
834
835
  env: mergedEnv,
@@ -849,8 +850,12 @@ async function createPiRpcBackend(input, dependencies, spawn) {
849
850
  if (!available?.models?.length)
850
851
  throw new Error("Pi has no authenticated available models. Run the official `pi` login flow or configure provider credentials; Larkin will not create a fallback session.");
851
852
  const effectiveModel = state.model?.provider && state.model.id ? `${state.model.provider}/${state.model.id}` : null;
852
- if (requestedModel && effectiveModel !== requestedModel)
853
+ // pi 回报的是 provider/model 两段式;Larkin 配置允许只存 model 段(内置 Pi 单 provider)。
854
+ const effectiveMatches = (candidate) => effectiveModel === candidate
855
+ || (effectiveModel ? effectiveModel.endsWith(`/${candidate}`) : false);
856
+ if (requestedModel && !effectiveMatches(requestedModel)) {
853
857
  throw new Error(`Pi model fallback refused: requested ${requestedModel}, effective ${effectiveModel || "none"}`);
858
+ }
854
859
  if (requestedEffort && state.thinkingLevel !== requestedEffort)
855
860
  throw new Error(`Pi thinking level ${requestedEffort} was not accepted by effective model ${effectiveModel || "unknown"}`);
856
861
  return new PiRpcBackend(client, state);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larkin",
3
- "version": "0.2.84",
3
+ "version": "0.2.86",
4
4
  "private": false,
5
5
  "larkinPackageRole": "npm-published",
6
6
  "files": [