Skip to content

OpenCode 2 Code Mode: when will AFT tools be available (plugin sets codemode: false)? #1004

Open

Description

@iceteaSA

Question

Will the OpenCode 2 plugin make AFT tools available in OpenCode 2 Code Mode, and when? If yes, what does a Code Mode call do when the permission decision is ask?

Current behaviour

Our test used an OpenCode 2 session with aft-opencode 0.62.0. In that session, the Code Mode execute runtime has no AFT tools. search() in the Code Mode catalog finds no AFT entry, for example read, grep, aft_outline, aft_search or shell. A call to tools.read(...) gives the error "Unknown tool". Thus Code Mode programs can use only MCP and host tools. They cannot read, search or change code through AFT.

The cause is in the plugin. Each V2 tool sets codemode: false, and the type makes this value necessary:

  • packages/opencode-plugin/src/tools/definitions/v2.ts:94 (options: … & { codemode: false })
  • packages/opencode-plugin/src/tools/definitions/v2.ts:383 (codemode: false on all V2 tools)

This option came in cefd1336c ("register V2 tool surface directly"). It is in v0.62.0 and in current main (6e9eeaa7a).

Engine work on main

main has engine work for Code Mode callers. This work is not in a release at this time:

The engine applies the head agent's policy to a Code Mode call. Grants stay on the parent identity (crates/aft/src/subc/access_grants.rs:35-42). At this time, no path sends an ask question to a person. The engine refuses the call with permission_ask_unavailable (crates/aft/src/access_policy.rs:174-182, crates/aft/src/subc/access_grants.rs:296-300).

Questions

  1. After the engine work is in a release, will the plugin remove codemode: false for some V2 tools or for all V2 tools? If for some, which tools? Examples are the read-only tools read, grep, glob, aft_outline, aft_zoom and aft_search.
  2. Does codemode: false stay until the path for ask questions is available? If yes, can the plugin first make available the read-only tools that do not use ask?
  3. When a Code Mode call gets the decision ask, is permission_ask_unavailable the last behaviour? Or will a subsequent change send the question to the head agent's user?
  4. Is there a release target or an issue that monitors this work?

Duplicate check

I searched issues and pull requests for "code mode", "codemode", "codemode plugin" and "Code Mode tools". No issue or pull request is about the plugin side.

Activity

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