Skip to content

Commit 317d858

Browse files
committed
fix: address CodeRabbit review on latest commits
- memory gate: stop logging the raw content preview (content[:60]) in the routing-flagged debug log — a declined/blocked write could otherwise leak secrets/PII; log only target + signals (CodeRabbit, major). - cli: drop the redundant local `logger` import in the exception-path cleanup; the enclosing function already binds `logger` in scope (CodeRabbit). - docs/build: the react bump moved web/vis to Vite 8, but build_vis.py, web/ AGENTS.md, and architecture.md still said "Vite 7". Update the labels (the Node engine constraint ^20.19.0 || >=22.12.0 is unchanged in Vite 8).
1 parent dcb1a19 commit 317d858

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/en/customization/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ is load-bearing for approval gating of persistent-backdoor vectors (`AGENTS.md`,
219219
| --- | --- | --- |
220220
| `src/pythinker_code/web/` | FastAPI backend (port 5494) managing CLI sessions via subprocess workers; bearer-token auth; `/api/*`; sensitive-path restriction. | `create_app`, `run_web_server`, `PythinkerCLIRunner`, `SessionProcess`, `AuthMiddleware` |
221221
| `src/pythinker_code/vis/` | FastAPI read-only tracing/statistics backend (port 5495) for the visualizer. | `create_app`, `run_vis_server` |
222-
| `web/` | React 19 + Vite 7 + TypeScript SPA chat UI; bundled into the package. See `web/AGENTS.md`. | `main.tsx`, `App`, `apiClient`, generated client `src/lib/api/`, `useSessionStream` |
222+
| `web/` | React 19 + Vite 8 + TypeScript SPA chat UI; bundled into the package. See `web/AGENTS.md`. | `main.tsx`, `App`, `apiClient`, generated client `src/lib/api/`, `useSessionStream` |
223223
| `vis/` | React 19 + Vite session-tracing visualizer. See `vis/AGENTS.md`. | `main.tsx`, `App`, hand-written `src/lib/api.ts` (`WireEvent`, `ContextMessage`, `SessionInfo`), feature panels under `src/features/` |
224224

225225
Both frontends build with `tsc -b && vite build` and are synced into the Python package by

scripts/build_vis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def resolve_npm() -> str | None:
3535

3636

3737
def check_node_version() -> bool:
38-
"""Vite 7 requires Node.js ^20.19.0 || >=22.12.0."""
38+
"""Vite 8 requires Node.js ^20.19.0 || >=22.12.0."""
3939
node = shutil.which("node")
4040
if not node:
4141
return False
@@ -47,7 +47,7 @@ def check_node_version() -> bool:
4747
ok = (major == 20 and minor >= 19) or (major >= 22 and (major > 22 or minor >= 12))
4848
if not ok:
4949
print(
50-
f"Node.js ^20.19.0 or >=22.12.0 required (Vite 7), found v{version}",
50+
f"Node.js ^20.19.0 or >=22.12.0 required (Vite 8), found v{version}",
5151
file=sys.stderr,
5252
)
5353
return False

src/pythinker_code/cli/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,8 +1203,6 @@ async def _reload_loop(session_id: str | None) -> tuple[str | None, int]:
12031203
# the most recent _run() call, which may have failed before returning.
12041204
# last_session is from a *previous* iteration and must not be touched.
12051205
if _latest_created_session is not None:
1206-
from pythinker_code.utils.logging import logger
1207-
12081206
try:
12091207
from pythinker_code.scratchpad import cleanup_session_scratch
12101208

src/pythinker_code/tools/memory/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ async def _confirm_flagged_write(
113113
signals = routing_signals(content)
114114
if not signals:
115115
return None
116+
# Log only structural metadata — never the entry content, which can carry
117+
# secrets/PII and may not be stored at all if the user declines the gate.
116118
logger.bind(event="memory_guard_gate", target=target, signals=signals).debug(
117-
"memory write flagged for confirmation: {preview}", preview=content[:60]
119+
"memory write flagged for confirmation"
118120
)
119121

120122
store_label = "project" if target == "memory" else "user"

web/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pythinker Web UI (web/)
22

3-
React 19 + Vite 7 + TypeScript SPA chat UI, bundled into the `pythinker-code` package. Run all
3+
React 19 + Vite 8 + TypeScript SPA chat UI, bundled into the `pythinker-code` package. Run all
44
`npm` commands from this directory.
55

66
## Critical invariants

0 commit comments

Comments
 (0)