Skip to content

Python SDK 0.1.2 is behind the current Droid JSON-RPC surface #3

Description

@mrwogu

Summary

droid-sdk-python==0.1.2 does not expose several RPC methods and request fields supported by the current Droid CLI and by @factory/droid-sdk==0.6.0. Applications must access the private DroidClient._protocol object to use these capabilities.

Tested on 2026-07-27 with:

  • Droid CLI 0.180.0
  • droid-sdk-python==0.1.2
  • @factory/droid-sdk==0.6.0

Missing request fields

droid.initialize_session

The Python initialize_session() method supports enabled_tool_ids, but not
disabled_tool_ids. enabledToolIds augments the default tool set and is not
an allowlist, so enabled_tool_ids=[] leaves default native tools enabled.

The protocol and TypeScript SDK support:

{
  "enabledToolIds": [],
  "disabledToolIds": ["read-cli", "execute-cli"]
}

droid.add_user_message

The Python add_user_message() method does not accept outputFormat.
The current protocol supports JSON Schema structured output:

{
  "text": "Return an answer.",
  "outputFormat": {
    "type": "json_schema",
    "schema": {
      "type": "object",
      "properties": {
        "answer": {"type": "integer"}
      },
      "required": ["answer"]
    }
  }
}

Missing methods

The current CLI accepts these RPC methods, and the TypeScript SDK exposes
typed equivalents:

RPC method TypeScript SDK method
droid.close_session closeSession()
droid.list_tools listTools()
droid.list_commands Low-level client support
droid.compact_session compactSession()
droid.fork_session forkSession()
droid.get_context_stats getContextStats()
droid.get_context_breakdown Protocol support
droid.rename_session renameSession()
droid.get_rewind_info getRewindInfo()
droid.execute_rewind executeRewind()

droid.list_tools is particularly important for security-sensitive clients.
It returns the actual CLI tool IDs plus defaultAllowed and
currentlyAllowed, which lets a client discover the current catalog, disable
every tool, and verify the result before sending a prompt.

Reproduction

The public Python method cannot express structured output:

await client.add_user_message(
    text="Return JSON.",
    output_format={  # Unexpected keyword argument
        "type": "json_schema",
        "schema": {"type": "object"},
    },
)

The same operation currently requires private access:

protocol = client._ensure_protocol()
await protocol.send_request(
    method="droid.add_user_message",
    params={
        "text": "Return JSON.",
        "outputFormat": {
            "type": "json_schema",
            "schema": {"type": "object"},
        },
    },
)

Likewise, reliably disabling native tools requires private RPC calls:

catalog = await protocol.send_request("droid.list_tools", {})
tool_ids = [tool["id"] for tool in catalog["result"]["tools"]]
await protocol.send_request(
    "droid.update_session_settings",
    {"enabledToolIds": [], "disabledToolIds": tool_ids},
)

Expected behavior

Please add typed Python APIs and schemas for the current protocol surface, including:

  1. disabled_tool_ids on session initialization and settings updates.
  2. output_format on user messages.
  3. Tool discovery.
  4. Session close, compact, fork, rename, context, and rewind methods.
  5. Current notification and result variants for structured output.

The public SDK should not require applications to access _protocol or _ensure_protocol().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions