{"record":{"id":"c7c096fa4b51a4fd","repo":"nanocoai/nanoclaw","slug":"agent-group-groupname-has-invalid-runtime-tie","errorCode":null,"errorMessage":"agent group \"${groupName}\" has invalid runtime_tier \"${raw}\" — expected \"container\" or \"vm\"","messagePattern":"agent group \"(.+?)\" has invalid runtime_tier \"(.+?)\" — expected \"container\" or \"vm\"","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/container-config.ts","lineNumber":327,"sourceCode":"        reason: err instanceof Error ? err.message : String(err),\n      });\n    }\n  }\n  return servers;\n}\n\n/**\n * runtime_tier is an isolation control: dropping an unknown stored value would\n * silently compose the group at the default tier — a weaker boundary than the\n * one the value asked for. Fail closed instead: the group refuses to compose\n * until the stored value is fixed. (A *declared* tier the driver cannot\n * realize is refused separately by validateSpec, against the driver's\n * capabilities.)\n */\nfunction parseRuntimeTier(raw: string | null | undefined, groupName: string): 'container' | 'vm' | undefined {\n  if (raw == null) return undefined;\n  if (raw === 'container' || raw === 'vm') return raw;\n  throw new Error(`agent group \"${groupName}\" has invalid runtime_tier \"${raw}\" — expected \"container\" or \"vm\"`);\n}\n\n/**\n * `'all'`, or the names the group selected. Anything else is treated as `'all'`:\n * a bare string would otherwise turn an `includes` filter into a substring\n * match and silently drop skills.\n *\n * The single reading of this column. `configFromDb` used to cast it instead,\n * which threw on a corrupt row before the composer's tolerance could apply:\n * every spawn failed, and `wakeContainer`'s retry contract darkened the group.\n * Two readings that must agree is also how the document ends up teaching a\n * skill the agent was never given.\n */\nexport function parseSkillSelection(raw: string | undefined, groupName: string): string[] | 'all' {\n  if (raw === undefined) return 'all';\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(raw);","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/container-config.ts#L309-L345","documentation":"parseRuntimeTier rejects a stored runtime_tier value on the agent group row that is neither 'container' nor 'vm'. The column is read when materializing config (configFromDb), so a corrupt or hand-edited row aborts spawn/config load with the group name and offending value in the message.","triggerScenarios":"UPDATE agent_groups SET runtime_tier='docker' (or any typo/NULL-string) directly in the central DB, then spawning a container or running ncl groups config get; also a future/older schema writing an unexpected value.","commonSituations":"Manual SQLite edits to data/v2.db; importing rows from another install with a different schema version; a partial migration leaving stale values.","solutions":["Fix the row: UPDATE agent_groups SET runtime_tier='container' (or NULL for default) WHERE id=...","If you meant VM isolation, set exactly 'vm'","Avoid hand-editing; use ncl groups update so validation runs","If this came from a migration, re-run the v2 migration and check schema_version"],"exampleFix":"-- before\nruntime_tier = 'docker'\n-- after\nruntime_tier = 'container'","handlingStrategy":"validation","validationCode":"const tier = row.runtime_tier; if (tier != null && tier !== 'container' && tier !== 'vm') throw new Error(`fix runtime_tier for ${row.id}`);","typeGuard":"function isValidRuntimeTier(v: unknown): v is 'container' | 'vm' { return v === 'container' || v === 'vm'; }","tryCatchPattern":"catch (err) { if (/invalid runtime_tier/.test(err.message)) haltSpawnAndAlertOperator(err); else throw err; }","preventionTips":["Never hand-edit agent_groups rows; use ncl groups update","Run migrations after upgrades so enum columns stay consistent","Alert on spawn-time config errors — they block all sessions for that group"],"tags":["agent-groups","db-integrity","runtime-config"],"backgroundTag":"invalid-enum-value-in-db","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}