Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

opencode.tools adds the execute / session_move hint even when Code Mode is denied

Đang mở Phù hợp với người mới
#57,711 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
67/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
ai-infra-agents

Hướng nghiên cứu

Plugin tích hợp sẵn opencode.tools thêm gợi ý vào các yêu cầu context, compaction và generate, còn Tool.snapshot xác định liệu execute có khả dụng hay không. Đọc các điểm vào đó và lần theo cách các quy tắc quyền của tác nhân phiên làm việc được chuyển đến plugin; kiểm tra các bài kiểm thử hiện có cho ảnh chụp trạng thái công cụ hoặc các phần của system prompt. Hoàn tất khi gợi ý bị lược bỏ ở những phiên mà execute bị từ chối hoàn toàn và vẫn khả dụng ở các phiên khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

reproduced
Description

When Code Mode is turned off with a permission rule ({ "action": "execute", "resource": "*", "effect": "deny" }), Tool.snapshot doesn't build the execute tool (codeModeEnabled = !whollyDisabled("execute", rules)), but the built-in opencode.tools plugin still adds this system part to every context, compaction and generate request:

When you create a worktree outside the current working directory and intend to use it as your primary working directory, consider using execute to call tools.opencode.session_move and make the worktree the session's working directory.

The model is told to use a tool it isn't offered (and tools.opencode.* are Code Mode only, so they aren't reachable either).

Expected: skip the hint when execute is wholly denied for the session's agent.

Related: #48749 (the hint now also reaches compaction and generate requests).

Plugins

Own plugins via the SDK (embedded host); the hint comes from the built-in opencode.tools.

OpenCode version

@opencode/core 2.0.32

Steps to reproduce
  1. Config with "permissions": [{ "action": "*", "resource": "*", "effect": "allow" }, { "action": "execute", "resource": "*", "effect": "deny" }].
  2. Send a prompt.
  3. The request has no execute tool, but its system prompt still contains the execute / tools.opencode.session_move hint.
Ngôn ngữ chính
TypeScript
Star
215k
Fork
28.9k
Merge trung bình
8 giờ 11 phút
Pull request đã merge (30 ngày)
365

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.