{"record":{"id":"50756a628fe5b10d","repo":"BerriAI/litellm","slug":"prompt-id-is-required-for-gitlab-prompt-manager","errorCode":null,"errorMessage":"prompt_id is required for GitLab prompt manager","messagePattern":"prompt_id is required for GitLab prompt manager","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/gitlab/gitlab_prompt_manager.py","lineNumber":484,"sourceCode":"    def should_run_prompt_management(\n        self,\n        prompt_id: str | None,\n        prompt_spec: PromptSpec | None,\n        dynamic_callback_params: StandardCallbackDynamicParams,\n    ) -> bool:\n        return prompt_id is not None\n\n    def _compile_prompt_helper(\n        self,\n        prompt_id: str | None,\n        prompt_spec: PromptSpec | None,\n        prompt_variables: dict | None,\n        dynamic_callback_params: StandardCallbackDynamicParams,\n        prompt_label: str | None = None,\n        prompt_version: int | None = None,\n    ) -> PromptManagementClient:\n        if prompt_id is None:\n            raise ValueError(\"prompt_id is required for GitLab prompt manager\")\n\n        try:\n            decoded_id: Final = decode_prompt_id(prompt_id)\n            if decoded_id not in self.prompt_manager.prompts:\n                git_ref: Final = (\n                    getattr(dynamic_callback_params, \"extra\", {}).get(\"git_ref\")\n                    if hasattr(dynamic_callback_params, \"extra\")\n                    else None\n                )\n                self.prompt_manager._load_prompt_from_gitlab(decoded_id, ref=git_ref)\n\n            rendered_prompt, prompt_metadata = self.get_prompt_template(prompt_id, prompt_variables)\n\n            messages: Final = self._parse_prompt_to_messages(rendered_prompt)\n            template_model: Final = prompt_metadata.get(\"model\")\n\n            optional_params: Final[dict[str, Any]] = {}\n            for param in [","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/gitlab/gitlab_prompt_manager.py#L466-L502","documentation":"Guard in GitLab prompt manager _compile_prompt_helper: prompt_id is None, but GitLab prompt management identifies prompts solely by prompt_id, so there is nothing to fetch from GitLab.","triggerScenarios":"Invoking the GitLab prompt manager without supplying prompt_id.","commonSituations":"Caller omitted prompt_id in the request payload or metadata.","solutions":["Pass prompt_id in the request when using the GitLab prompt manager."],"exampleFix":"litellm.completion(model='gpt-4', prompt_id='my_prompt', messages=[{'role':'user','content':'hi'}])","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}