{"record":{"id":"2aee8fe8cbc49623","repo":"coleam00/Archon","slug":"run-config-key-assistants-pi-maxconcurrent-canno","errorCode":null,"errorMessage":"Run config key 'assistants.pi.maxConcurrent' cannot apply: Pi concurrency is initialized once for the process lifetime.","messagePattern":"Run config key 'assistants\\.pi\\.maxConcurrent' cannot apply: Pi concurrency is initialized once for the process lifetime\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/config/run-config.ts","lineNumber":132,"sourceCode":"  }\n}\n\n/** Validate and normalize constraints owned by the live provider registry and lifecycle. */\nexport function normalizeRunConfigSemantics(layer: WorkflowRunConfigLayer): WorkflowRunConfigLayer {\n  if (layer.assistant !== undefined) {\n    assertRegisteredProvider(layer.assistant, 'assistant');\n  }\n  const assistants: Record<string, Record<string, unknown>> = {};\n  for (const [provider, defaults] of Object.entries(layer.assistants ?? {})) {\n    assertRegisteredProvider(provider, `assistants.${provider}`);\n    if (provider === 'pi' && Object.hasOwn(defaults, 'env')) {\n      throw new Error(\n        \"Run config key 'assistants.pi.env' cannot apply: Pi extension environment mutates \" +\n          'process.env and is process-scoped.'\n      );\n    }\n    if (provider === 'pi' && Object.hasOwn(defaults, 'maxConcurrent')) {\n      throw new Error(\n        \"Run config key 'assistants.pi.maxConcurrent' cannot apply: Pi concurrency is \" +\n          'initialized once for the process lifetime.'\n      );\n    }\n    try {\n      assistants[provider] = getRegistration(provider).parseRunConfig(defaults);\n    } catch (error) {\n      if (error instanceof InvalidProviderRunConfigError) {\n        const suffix = error.fieldPath ? `.${error.fieldPath}` : '';\n        throw new Error(\n          `Invalid run config at 'assistants.${provider}${suffix}': ${error.message}.`\n        );\n      }\n      throw error;\n    }\n  }\n  const tiers = Object.fromEntries(\n    Object.entries(layer.tiers ?? {}).map(([tier, preset]) => [","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/config/run-config.ts#L114-L150","documentation":"The 'pi' provider rejects the 'maxConcurrent' key in run config assistant defaults because Pi concurrency is initialized once for the process lifetime and cannot be changed per run. The config layer fails fast rather than letting a per-run value have no effect.","triggerScenarios":"Calling runConfig(), parseWorkflowRunConfig(), or unsealWorkflowRunConfig() with assistants: { pi: { maxConcurrent: N } }.","commonSituations":"Porting a run config that sets maxConcurrent for other providers (e.g. claude, codex) over to pi; tuning parallelism per workflow and forgetting pi is process-wide.","solutions":["Remove 'maxConcurrent' from assistants.pi in the run config","Configure Pi concurrency once at process startup via its provider configuration","Use a provider that supports per-run concurrency if per-run tuning is required"],"exampleFix":"// before\nassistants:\n  pi:\n    maxConcurrent: 4\n// after\nassistants:\n  pi: {}  # set concurrency in pi provider startup config","handlingStrategy":"validation","validationCode":"function assertPiAssistantDefaults(defaults) { if (defaults && ('maxConcurrent' in defaults)) throw new Error(\"assistants.pi.maxConcurrent is not supported; set concurrency at process startup\"); }","typeGuard":"function hasPiMaxConcurrent(layer) { return typeof layer?.assistants?.pi === 'object' && layer.assistants.pi !== null && 'maxConcurrent' in layer.assistants.pi; }","tryCatchPattern":"try { cfg = parseWorkflowRunConfig(doc, source); } catch (e) { if (String(e.message).includes('assistants.pi.maxConcurrent')) { console.error('Configure pi concurrency once at process startup'); } throw e; }","preventionTips":["Set pi concurrency only in provider startup configuration","Strip process-scoped pi keys when generating per-workflow configs","Add a CI check rejecting maxConcurrent under assistants.pi"],"tags":["config","pi-provider","concurrency"],"backgroundTag":"unsupported-config-key","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}