{"record":{"id":"cadec811a89ff2bc","repo":"HKUDS/DeepTutor","slug":"the-installed-codebuddy-agent-sdk-does-not-accept","errorCode":null,"errorMessage":"The installed codebuddy-agent-sdk does not accept the turn limit and permission mode this provider requires. Install a supported version (pip install \"deeptutor[codebuddy]\").","messagePattern":"The installed codebuddy-agent-sdk does not accept the turn limit and permission mode this provider requires\\. Install a supported version \\(pip install \"deeptutor\\[codebuddy\\]\"\\)\\.","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/llm/provider_core/codebuddy_provider.py","lineNumber":440,"sourceCode":"        {\"maxTurns\": 1, \"permissionMode\": \"plan\"},\n    ):\n        restricted = {\n            **model_kwargs,\n            **env_kwargs,\n            **reasoning_kwargs,\n            **tool_kwargs,\n            **guard,\n        }\n        if max_tokens > 0:\n            candidates.append({**restricted, \"max_tokens\": max_tokens})\n        candidates.append(restricted)\n\n    for kwargs in candidates:\n        try:\n            return options_cls(**kwargs)\n        except TypeError:\n            continue\n    raise RuntimeError(\n        \"The installed codebuddy-agent-sdk does not accept the turn limit and \"\n        \"permission mode this provider requires. Install a supported version \"\n        '(pip install \"deeptutor[codebuddy]\").'\n    )\n\n\ndef _build_tool_options(sdk: ModuleType, tools: list[dict[str, Any]] | None) -> dict[str, Any]:\n    if not tools:\n        return {\"tools\": []}\n    decorate = getattr(sdk, \"tool\", None)\n    create_server = getattr(sdk, \"create_sdk_mcp_server\", None)\n    if not callable(decorate) or not callable(create_server):\n        return {\"tools\": []}\n\n    sdk_tools: list[Callable[..., Any]] = []\n    allowed: list[str] = []\n    for schema in tools:\n        function = schema.get(\"function\") if isinstance(schema, dict) else None","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/llm/provider_core/codebuddy_provider.py#L422-L458","documentation":"_build_options() tries several candidate kwargs for the SDK's options class (turn limit, permission mode) and every attempt raised TypeError — the installed SDK's options object doesn't accept those parameters. This is an SDK/provider version mismatch: the provider requires newer options fields the installed SDK lacks (or renamed).","triggerScenarios":"Running _run_one_shot or _get_session with an older codebuddy-agent-sdk whose options class has different constructor signatures; provider code updated to pass max_turns/permission_mode but SDK not upgraded.","commonSituations":"Upgrading deeptutor without upgrading the codebuddy extra, mixed lockfile versions, vendored or forked SDKs with diverging signatures.","solutions":["pip install \"deeptutor[codebuddy]\" to get the supported SDK version.","Verify with pip show codebuddy-agent-sdk that the version matches deeptutor's constraint.","If you must use an older SDK, pin the matching older deeptutor release."],"exampleFix":"# before\npip install codebuddy-agent-sdk==0.1.0  # old options signature\n\n# after\npip install \"deeptutor[codebuddy]\"","handlingStrategy":"validation","validationCode":"import inspect, codebuddy_agent_sdk\nopts = getattr(codebuddy_agent_sdk, \"Options\", None)\nif opts is None or not any(\"permission\" in p for p in inspect.signature(opts).parameters):\n    print(\"Unsupported SDK version — pip install 'deeptutor[codebuddy]'\")","typeGuard":"def sdk_options_compatible() -> bool:\n    try:\n        import inspect\n        from codebuddy_agent_sdk import Options\n        params = inspect.signature(Options).parameters\n        return any(\"permission\" in p for p in params)\n    except Exception:\n        return False","tryCatchPattern":"try:\n    result = provider.run_one_shot(...)\nexcept RuntimeError as e:\n    if \"does not accept the turn limit\" in str(e):\n        logger.error(\"Upgrade: pip install 'deeptutor[codebuddy]'\")\n    raise","preventionTips":["Always install the SDK via the deeptutor extra, never standalone.","Run sdk_options_compatible() as a preflight in deployment checks.","Keep deeptutor and its extras upgraded together."],"tags":["codebuddy","version-mismatch","constructor","options"],"backgroundTag":"sdk-version-incompatible","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}