{"record":{"id":"6f7118474ea520da","repo":"nikivdev/code","slug":"remote-commit-message-requires-an-active-subscript","errorCode":null,"errorMessage":"remote commit message requires an active subscription. Visit myflow to subscribe.","messagePattern":"remote commit message requires an active subscription\\. Visit myflow to subscribe\\.","errorType":"exception","errorClass":null,"httpStatus":402,"severity":"error","filePath":"src/commit.rs","lineNumber":13017,"sourceCode":"    let payload = json!({\n        \"diff\": diff,\n        \"status\": status,\n        \"truncated\": truncated,\n    });\n\n    let response = client\n        .post(&url)\n        .bearer_auth(token)\n        .json(&payload)\n        .send()\n        .context(\"failed to request remote commit message\")?;\n\n    if !response.status().is_success() {\n        if response.status() == StatusCode::UNAUTHORIZED {\n            bail!(\"remote commit message unauthorized. Run `f auth` to login.\");\n        }\n        if response.status() == StatusCode::PAYMENT_REQUIRED {\n            bail!(\n                \"remote commit message requires an active subscription. Visit myflow to subscribe.\"\n            );\n        }\n        let status = response.status();\n        let body = response.text().unwrap_or_default();\n        bail!(\"remote commit message failed: HTTP {} {}\", status, body);\n    }\n\n    let payload: RemoteCommitMessageResponse = response\n        .json()\n        .context(\"failed to parse remote commit message response\")?;\n\n    let message = payload.message.trim().to_string();\n    if message.is_empty() {\n        bail!(\"remote commit message was empty\");\n    }\n\n    Ok(trim_quotes(&message))","sourceCodeStart":12999,"sourceCodeEnd":13035,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L12999-L13035","documentation":"Thrown when the remote commit-message endpoint responds with HTTP 402 Payment Required, meaning the account has no active subscription. The message directs the user to subscribe via myflow.","triggerScenarios":"Requesting AI commit messages from the remote API while the account's subscription is inactive, lapsed, or quota-exhausted.","commonSituations":"Free trial ended; subscription payment failed/expired; account downgraded; usage credits exhausted for the billing period.","solutions":["Subscribe or renew the subscription at myflow.","Verify the payment method is valid and billing is current on the account.","Log out and back in (`f auth`) so the client picks up updated entitlements.","Confirm with the account/plan status endpoint whether quota or subscription is the blocker."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify subscription status before calling the remote endpoint\n// e.g. via account/status API, or check cached entitlement flag\nif !account.has_active_subscription {\n    return Err(anyhow!(\"Subscription required. Visit myflow to subscribe.\"));\n}","typeGuard":"fn subscription_active(status: &AccountStatus) -> bool {\n    status.subscribed && !status.trial_expired\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"subscription\") => {\n        eprintln!(\"Subscribe at myflow to keep using remote AI commit messages.\");\n        open_subscribe_url();\n    }\n    other => other,\n}","preventionTips":["Keep billing/payment methods current on your myflow account.","Check subscription/quota status before batch operations.","Cache entitlement state and warn before it lapses.","Fall back to local generation when unsubscribed."],"tags":["billing","subscription","http-402","remote-api"],"backgroundTag":"subscription-required","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}