{"record":{"id":"b4ecfe210f756696","repo":"slopus/happy","slug":"happy-session-session-id-uses-unsupported-flavo","errorCode":null,"errorMessage":"Happy session ${session.id} uses unsupported flavor \"${metadata.flavor ?? 'unknown'}\".","messagePattern":"Happy session (.+?) uses unsupported flavor \"(.+?)\"\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/happy-cli/src/resume/handleResumeCommand.ts","lineNumber":89,"sourceCode":"    if (flavor === 'claude') {\n        if (!metadata.claudeSessionId) {\n            throw new Error(`Happy session ${session.id} is missing its Claude session ID.`);\n        }\n        const args = ['claude'];\n        if (options.claudeStartingMode) {\n            args.push('--happy-starting-mode', options.claudeStartingMode);\n        }\n        if (options.startedBy) {\n            args.push('--started-by', options.startedBy);\n        }\n        args.push('--resume', metadata.claudeSessionId);\n        return {\n            cwd: metadata.path,\n            args,\n        };\n    }\n\n    throw new Error(`Happy session ${session.id} uses unsupported flavor \"${metadata.flavor ?? 'unknown'}\".`);\n}\n\nexport function formatResumeHelp(): string {\n    return [\n        'happy resume - Resume a previous Happy session',\n        '',\n        'Usage:',\n        '  happy resume <happy-session-id>',\n        '',\n        'Examples:',\n        '  happy resume cmmij8olq00dp5jcxr3wtbpau',\n        '  happy resume cmmij8',\n        '',\n        'This reuses the saved worktree/path and resumes the underlying agent session',\n        'when the backend supports it.',\n    ].join('\\n');\n}\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/resume/handleResumeCommand.ts#L71-L107","documentation":"buildResumeLaunch throws this when resolveFlavor(metadata) returns a flavor that is neither 'codex' nor 'claude'. The switch only handles those two flavors; anything else (including undefined metadata.flavor, rendered as 'unknown') is explicitly unsupported for resume.","triggerScenarios":"Calling buildResumeLaunch with metadata.flavor set to an unrecognized string (typo, newer CLI writing a flavor this version doesn't know, e.g. 'gemini'), or flavor missing entirely so it falls through both if-branches.","commonSituations":"Downgraded happy-cli reading metadata written by a newer version with a new flavor; manually edited sessions file with a bad flavor value; corrupted decrypted metadata where ResumableMetadataSchema allowed an unknown flavor string.","solutions":["Upgrade happy-cli to the latest version so it recognizes the flavor written by the session's original CLI","Check metadata.flavor for typos if you manage the sessions file manually","Start a new session with a supported flavor (claude or codex)","Inspect decrypted session metadata to confirm the flavor value stored for this session"],"exampleFix":"// before (older CLI reading newer metadata)\nflavor: \"gemini\"  // -> unsupported flavor \"gemini\"\n// after\nnpm i -g happy-coder@latest && happy resume <session-id>","handlingStrategy":"validation","validationCode":"const SUPPORTED_FLAVORS = ['claude', 'codex'] as const;\nfunction isResumableFlavor(m: Metadata): boolean {\n  return SUPPORTED_FLAVORS.includes(resolveFlavor(m) as any);\n}\nif (!isResumableFlavor(session.metadata)) {\n  console.error('Unsupported flavor; upgrade happy-cli.');\n  process.exit(1);\n}","typeGuard":"function isSupportedFlavor(m: Metadata): m is Metadata & { flavor: 'claude' | 'codex' } {\n  const f = resolveFlavor(m);\n  return f === 'claude' || f === 'codex';\n}","tryCatchPattern":"try {\n  const launch = buildResumeLaunch(session);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('unsupported flavor')) {\n    console.error(e.message + ' — upgrade happy-cli to support this session type.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Run the latest happy-cli so all flavors written by newer sessions are recognized","Whitelist known flavors before attempting resume","Avoid manually editing the flavor field in persisted metadata","Check release notes when downgrading CLI versions"],"tags":["flavor","resume","unsupported-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"b824cd0a4681d41af631a8e422a813873e4455b0","analyzedAt":"2026-08-31T23:12:36.205Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}