From 492a1410eea437263fdbdbd5b489731e62c4d099 Mon Sep 17 00:00:00 2001 From: Josh Mabry Date: Mon, 28 Sep 2026 15:03:59 -0700 Subject: [PATCH] =?UTF-8?q?chore:=20thread-tools=20follow-ups=20from=20Ver?= =?UTF-8?q?a=20=E2=80=94=20PROTO=20=C2=A73=20inventory=20counts,=20plain?= =?UTF-8?q?=20import=20re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 (1M context) --- PROTO.md | 4 ++-- write_tools.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/PROTO.md b/PROTO.md index c1a6480..f78e30c 100644 --- a/PROTO.md +++ b/PROTO.md @@ -40,8 +40,8 @@ gh_cli.py # vendored async `gh` runner: binary resolution (PATH + # injection (config secret > env), check_gh_error CLASSIFICATION, bad_repo status.py # the first-run probe: compute_status / summarize_status / report_gaps (setup-gap seam) projects.py # repo sources: host projects: registry (ADR 0095) + checkout `origin` remote parsing -read_tools.py # 15 read tools (6 ported core + file/contents/pr-file/path-exists/pr-diff + status + list_prs/comments/search) -write_tools.py # 8 write tools (create/edit/merge/close/comment/labels/assignees) — gated +read_tools.py # 16 read tools (6 ported core + file/contents/pr-file/path-exists/pr-diff + status + list_prs/comments/search + review_threads) +write_tools.py # 10 write tools (create/edit/merge/close/comment/labels/assignees + reply/resolve review threads) — gated review_tools.py # 3 verdict tools (comment/approve/request-changes, guarded) — gated gh_issue.py # /issue chat command logic + repo resolution (resolve_repo, default_repo_error) api.py # routers — public PAGES (view/new-issue) + gated data routes (config/status/issues/prs/issue) diff --git a/write_tools.py b/write_tools.py index 1326eef..b0888dc 100644 --- a/write_tools.py +++ b/write_tools.py @@ -33,6 +33,8 @@ from __future__ import annotations +import re + from langchain_core.tools import tool from .gh_cli import bad_repo, check_gh_error, parse_json, run_gh @@ -50,7 +52,7 @@ def _pr_number(url: str) -> str: return tail if tail.isdigit() else "" -_THREAD_ID_RE = __import__("re").compile(r"^PRRT_[A-Za-z0-9_-]{6,}$") +_THREAD_ID_RE = re.compile(r"^PRRT_[A-Za-z0-9_-]{6,}$") def _bad_thread_id(thread_id: str) -> str | None: