{"record":{"id":"651149f90ed66c1f","repo":"iflytek/astron-agent","slug":"app-plat-not-release-op-error","errorCode":"APP_PLAT_NOT_RELEASE_OP_ERROR","errorMessage":"Error: {SOURCE_MAPPING[plat]} does not support {RELEASE_MAPPING[release_status]} operation","messagePattern":"Error: (.+?) does not support (.+?) operation","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"warning","filePath":"core/workflow/service/publish_service.py","lineNumber":146,"sourceCode":"\n\nasync def _get_release_status(release_status: int, plat: int, span: Span) -> int:\n    \"\"\"\n    Get and validate release status for the specified platform.\n\n    Uses the tenant publish matrix to determine the appropriate release status\n    for the given platform and validates that the operation is supported.\n\n    :param release_status: The requested release status operation\n    :param plat: Target platform identifier\n    :param span: Tracing span for observability\n    :return: The validated release status for the platform\n    :raises CustomException: If the release operation is not supported for the platform\n    \"\"\"\n    rs = TenantPublishMatrix(plat).get_release_status(release_status)\n    await span.add_info_event_async(f\"Release status: {rs}\")\n    if rs == -1:\n        raise CustomException(\n            CodeEnum.APP_PLAT_NOT_RELEASE_OP_ERROR,\n            err_msg=f\"Error: {SOURCE_MAPPING[plat]} \"\n            f\"does not support {RELEASE_MAPPING[release_status]} operation\",\n        )\n    return rs\n\n\ndef _update_flow_release_status(\n    db_flow: Flow, release_status: int, publish_input: PublishInput, plat: int\n) -> None:\n    \"\"\"\n    Update workflow release status based on the operation type.\n\n    Handles different release operations (take off, publish, publish API) by\n    updating the workflow's release status flags appropriately and clearing\n    conflicting statuses.\n\n    :param db_flow: The workflow object to update","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/service/publish_service.py#L128-L164","documentation":"APP_PLAT_NOT_RELEASE_OP_ERROR raised in publish_service._get_release_status when TenantPublishMatrix(plat).get_release_status(release_status) returns -1, meaning the target platform does not support the requested release operation (e.g., offline/rollback on a platform that only supports online publish).","triggerScenarios":"handle → _get_release_status called with a (plat, release_status) combination absent from the tenant publish matrix — such as requesting an unpublish/release_status value on a platform that only supports publishing.","commonSituations":"Client requesting 'offline' or 'rollback' on a platform that only supports 'online', using a release_status enum value not defined for that platform, API version mismatch exposing new ops on old platforms.","solutions":["Use a release_status supported by the target platform (consult TenantPublishMatrix/RELEASE_MAPPING)","Check RELEASE_MAPPING and the publish matrix for valid (plat, release_status) pairs","Fix the client request to send only the platform-supported operation","If the operation should be supported, add it to TenantPublishMatrix for that platform"],"exampleFix":"// before\npublish(plat=PLATFORM_X, release_status=OFFLINE)  # PLATFORM_X has no offline op\n// after\npublish(plat=PLATFORM_X, release_status=ONLINE)  # supported op for this platform","handlingStrategy":"validation","validationCode":"rs = TenantPublishMatrix(plat).get_release_status(release_status)\nif rs == -1:\n    raise ValueError(f'{plat} does not support release_status={release_status}')","typeGuard":null,"tryCatchPattern":"try:\n    publish_service.handle(...)\nexcept CustomException as e:\n    if e.err_code == CodeEnum.APP_PLAT_NOT_RELEASE_OP_ERROR:\n        return error_response(400, 'Operation not supported on this platform; check supported release ops')\n    raise","preventionTips":["Derive UI publish buttons from the platform's supported release ops","Consult RELEASE_MAPPING / TenantPublishMatrix when adding new ops","Keep client release_status enums in sync with server mappings","Gate new operations per platform behind feature flags"],"tags":["publish","platform","unsupported-operation","release-status"],"backgroundTag":"unsupported-operation","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}