Skip to content

SessionCreate: models have no way to get rootId/directoryIdentity for a directory workspace #6630

Closed

Description

@M4n5ter SessionCreate asks the model for a directory (or isolated_git / project) workspace as an AgentDirectorySelection: rootId, segments and directoryIdentity (^sha256:[a-f0-9]{64}$). No model tool returns these values, and the tool description is only "Create a conversation in a selected workspace." So when a user says "start a conversation in ~/some/dir", the model has to guess them.

What we saw on rust-preview 89e7dcd, after #6626 fixed the JSON-string encoding (arguments now arrive as objects):

  • The Bot on K2.8 Preview sent rootId: "downloads" and directoryIdentity = the SHA-256 of the empty string. The Host answered workspace_unavailable, and the Bot told the user the directory "is not authorized yet", which is not the cause.
  • A normal conversation on K3.1 Pro sent rootId: "root-1" with a made-up hash. Then it spent 8+ minutes and 59 tool calls looking for a way to compute the identity: grepping source checkouts, opening the Host Root databases read-only, running nm and objdump on the maka binary, and hashing inode and path combinations. Its sandbox was off.

Only {"kind": "session", "sessionId": …}, which reuses an existing conversation's workspace, can be filled in from what the model can see (via SessionList).

The Host already has the data: the directories query (plugins/agent/native/src/service.rs) returns AgentDirectoryPage entries that carry a ready selection, but only the UI calls it. WorkHub's workhub_tasks has a per-worker Directories catalog action, which is a different path.

Possible directions; which one fits depends on whether model-chosen directories are meant to be allowed at all:

  1. A read-only model tool over the existing directories query (roots, then children), so the model picks a real selection.
  2. Let SessionCreate take a path and have the Host resolve and authorize it.
  3. If only the current workspace or existing sessions' workspaces should be reachable, say so in the SessionCreate description and steer models to kind: "session", so they stop guessing.

Is this something you plan to handle, or would you like us to take it? If you tell us which direction you prefer, we can open a PR.

Activity

  1. added a commit that references this issue on Nov 4, 2026
    499c770
  2. UncertaintyDeterminesYou4ndMe commented on Nov 4, 2026

    @UncertaintyDeterminesYou4ndMe
    ContributorAuthor

    Taking this one: #6632 adds a WorkspaceLookup model tool over the existing directories query, with a lookup by path, and points SessionCreate at it. Happy to change direction if you would rather not expose directory browsing to models.

  3. M4n5ter commented on Nov 4, 2026

    @M4n5ter
    Member
    English

    Let's go with Direction 2 and drop caller-facing DirectorySelection in favor of taking path directly—left concrete notes on #6632 (comment).

    简体中文

    按方向 2 走,直接去掉调用方侧的 DirectorySelection、统一改为接收 path——具体说明见 https://github.com/apache/maka/pull/6632#issuecomment-6634096352。

  4. added a commit that references this issue on Nov 4, 2026
    e74cf5b
  5. added 3 commits that reference this issue on Nov 6, 2026
    eb09c6f
    5fe3df7
    445767c
  6. UncertaintyDeterminesYou4ndMe commented on Nov 6, 2026

    @UncertaintyDeterminesYou4ndMe
    ContributorAuthor

    Fixed by #6632 (445767c): agent.create and the other workspace-selecting inputs take a path now, and the Host resolves it and captures the directory identity, so a model no longer has to supply rootId or directoryIdentity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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