[bug-hunter] Copilot SDK no-sandbox mention workflows block `read` tool in runtime allowlist

Aperta Adatta ai principianti
#2,514 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github, github-actions, python
Ambito
devops, tooling

Direzione di ricerca

Inizia leggendo i file di workflow generati .github/workflows/gh-aw-mention-in-issue-no-sandbox.lock.yml e .github/workflows/gh-aw-mention-in-pr-no-sandbox.lock.yml, quindi confronta GH_AW_COPILOT_SDK_TOOL_CONFIG.permissions.allowedTools con gli argomenti --allow-tool dell’SDK. Esegui lo script di riproduzione dell’issue per confermare la discrepanza. Il lavoro è completato quando read è presente in entrambe le allowlist e lo script viene eseguito correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Impact

gh-aw-mention-in-issue-no-sandbox and gh-aw-mention-in-pr-no-sandbox advertise read as an allowed tool, but their generated Copilot SDK server args do not permit read. In SDK mode, this can block agents from reading repository files, causing degraded or failed analysis/fix behavior in user-triggered mention workflows.

Reproduction Steps

  1. Run the following script from repo root:
import json
import pathlib
import re
import sys

WORKFLOWS = [
    ".github/workflows/gh-aw-mention-in-issue-no-sandbox.lock.yml",
    ".github/workflows/gh-aw-mention-in-pr-no-sandbox.lock.yml",
]

mismatches = []
for path in WORKFLOWS:
    text = pathlib.Path(path).read_text()
    server_args = json.loads(re.search(r"GH_AW_COPILOT_SDK_SERVER_ARGS: '([^']+)'", text).group(1))
    tool_cfg = json.loads(re.search(r"GH_AW_COPILOT_SDK_TOOL_CONFIG: '([^']+)'", text).group(1))

    allowlist = [server_args[i + 1] for i, tok in enumerate(server_args[:-1]) if tok == "--allow-tool"]
    cfg_tools = tool_cfg["permissions"]["allowedTools"]

    print(f"{path}")
    print(f"  read in allowedTools config : {'read' in cfg_tools}")
    print(f"  read in --allow-tool args   : {'read' in allowlist}")

    if "read" in cfg_tools and "read" not in allowlist:
        mismatches.append(path)

if mismatches:
    print("\nFAIL: 'read' is configured but blocked by SDK server allowlist in:")
    for path in mismatches:
        print(f"- {path}")
    sys.exit(1)

print("\nPASS")
  1. Execute with python /tmp/gh-aw/agent/repro_read_tool_mismatch.py (or inline via python - <<'PY' ... PY).

Expected vs Actual

Expected: If read appears in GH_AW_COPILOT_SDK_TOOL_CONFIG.permissions.allowedTools, it should also be present in SDK --allow-tool args.

Actual: Script exits non-zero and reports mismatch:

.github/workflows/gh-aw-mention-in-issue-no-sandbox.lock.yml
  read in allowedTools config : True
  read in --allow-tool args   : False
.github/workflows/gh-aw-mention-in-pr-no-sandbox.lock.yml
  read in allowedTools config : True
  read in --allow-tool args   : False

FAIL: 'read' is configured but blocked by SDK server allowlist in:
- .github/workflows/gh-aw-mention-in-issue-no-sandbox.lock.yml
- .github/workflows/gh-aw-mention-in-pr-no-sandbox.lock.yml

Failing Test

The script above is a minimal failing test: it deterministically exits with code 1 when a workflow claims read in tool config but omits it from SDK runtime allowlist.

Evidence

  • .github/workflows/gh-aw-mention-in-issue-no-sandbox.md:21 enables copilot-sdk: true.
  • .github/workflows/gh-aw-mention-in-pr-no-sandbox.md:28 enables copilot-sdk: true.
  • .github/workflows/gh-aw-mention-in-issue-no-sandbox.lock.yml:1692-1693 has allowedTools containing read, but GH_AW_COPILOT_SDK_SERVER_ARGS omits --allow-tool read.
  • .github/workflows/gh-aw-mention-in-pr-no-sandbox.lock.yml:2240-2241 shows the same mismatch.

What is this? | From workflow: Trigger Bug Hunter

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

  • expires on Nov 23, 2026, 11:23 AM UTC
Lingua principale
Python
Stelle
13
Fork
16
Merge medio
45m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di elastic/ai-github-actions

Tutte le issue di elastic/ai-github-actions

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.