• Will Chen's avatar
    feat: enable read-only local agent for pro ask mode (#2260) · f44ad715
    Will Chen 提交于
    For pro users, ask mode now uses the local agent handler in read-only
    mode, giving them access to code reading tools (read_file, list_files,
    grep, code_search, etc.) while preventing any state modifications.
    
    Changes:
    - Add `modifiesState` property to ToolDefinition interface
    - Mark state-modifying tools (write_file, edit_file, delete_file,
    rename_file, add_dependency, execute_sql, add_integration)
    - Add `readOnly` option to buildAgentToolSet to filter out
    state-modifying tools
    - Add `readOnly` option to handleLocalAgentStream to skip commits/
    deploys and exclude MCP tools in read-only mode
    - Create LOCAL_AGENT_ASK_SYSTEM_PROMPT for read-only agent mode
    - Route pro ask mode users to local agent with readOnly: true
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > Enables read-only local-agent behavior for Pro users in `ask` mode,
    providing code-inspection tools without allowing modifications.
    > 
    > - Route `ask` → local-agent with `readOnly: true` (when Pro and no
    mentioned apps); persist `aiMessagesJson` for these modes
    > - Add `modifiesState` to `ToolDefinition`; mark state-changing tools
    and filter them in `buildAgentToolSet({ readOnly })`; exclude MCP tools
    in read-only
    > - Update `handleLocalAgentStream` to support `readOnly`: skip
    commits/deploys and return `updatedFiles: false`
    > - Introduce `LOCAL_AGENT_ASK_SYSTEM_PROMPT` and plumb `readOnly`
    through `constructSystemPrompt`/`constructLocalAgentPrompt`
    > - E2E: new ask-mode tests/fixtures and snapshot updates; add
    deterministic normalization of tool_call IDs in test helper
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    a67cbc1ccad35bf1fad9277bfce14a8999e763ca. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Pro ask mode now uses the local agent in read-only mode, letting users
    read and search code without changing anything. Commits, deploys, and
    state-modifying tools are disabled.
    
    - **New Features**
    - Route Pro ask mode to the local agent with readOnly: true when no
    other apps/codebases are mentioned.
    - Tools declare modifiesState;
    write/edit/delete/rename/add_dependency/execute_sql/add_integration are
    marked and excluded in read-only mode.
    - buildAgentToolSet and handleLocalAgentStream support readOnly to
    filter tools, skip MCP tools, and avoid commits/deploys (updatedFiles:
    false).
    - Added LOCAL_AGENT_ASK_SYSTEM_PROMPT and prompt wiring to support
    read-only behavior.
    
    <sup>Written for commit a67cbc1ccad35bf1fad9277bfce14a8999e763ca.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarClaude <noreply@anthropic.com>
    f44ad715
名称
最后提交
最后更新
.claude 正在载入提交数据...
.cursor/rules 正在载入提交数据...
.devcontainer 正在载入提交数据...
.github 正在载入提交数据...
.husky 正在载入提交数据...
assets 正在载入提交数据...
docs 正在载入提交数据...
drizzle 正在载入提交数据...
e2e-tests 正在载入提交数据...
makers 正在载入提交数据...
packages/@dyad-sh 正在载入提交数据...
scaffold 正在载入提交数据...
scripts 正在载入提交数据...
shared 正在载入提交数据...
src 正在载入提交数据...
testing 正在载入提交数据...
tools 正在载入提交数据...
worker 正在载入提交数据...
workers/tsc 正在载入提交数据...
.cursorignore 正在载入提交数据...
.env.example 正在载入提交数据...
.eslintrc.json 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.oxlintrc.json 正在载入提交数据...
.prettierignore 正在载入提交数据...
.prettierrc 正在载入提交数据...
AGENTS.md 正在载入提交数据...
CLA.md 正在载入提交数据...
CLAUDE.md 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
SECURITY.md 正在载入提交数据...
biome.json 正在载入提交数据...
components.json 正在载入提交数据...
drizzle.config.ts 正在载入提交数据...
forge.config.ts 正在载入提交数据...
forge.env.d.ts 正在载入提交数据...
index.html 正在载入提交数据...
lint-staged.config.js 正在载入提交数据...
merge.config.ts 正在载入提交数据...
package-lock.json 正在载入提交数据...
package.json 正在载入提交数据...
playwright.config.ts 正在载入提交数据...
tsconfig.app.json 正在载入提交数据...
tsconfig.json 正在载入提交数据...
tsconfig.node.json 正在载入提交数据...
vite.main.config.mts 正在载入提交数据...
vite.preload.config.mts 正在载入提交数据...
vite.renderer.config.mts 正在载入提交数据...
vite.worker.config.mts 正在载入提交数据...
vitest.config.ts 正在载入提交数据...