Sanitize wizard remarks and make remark parsing robust
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu với src/lib/agent/output-signals.ts, bao gồm AgentOutputSignals.remark() và kiểm tra echo của REMARK_INSTRUCTION, sau đó lần theo lệnh gọi analytics.capture cho WIZARD_REMARK_EVENT_NAME. Xem lại luồng remark hiện có và xác định nơi nên kiểm thử việc phân phối có cấu trúc và việc làm sạch; được xem là hoàn tất khi đã kiểm thử việc phân phối remark có kiểu, các echo và giá trị rỗng bị từ chối, cùng các analytics payload đã được làm sạch.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The end-of-run "remark" is free-form model output that we extract from the agent's prose by string-matching a [WIZARD-REMARK] marker (AgentOutputSignals.remark() in src/lib/agent/output-signals.ts) and then ship straight to analytics:
const remark = signals.remark();
if (remark) analytics.capture(WIZARD_REMARK_EVENT_NAME, { remark });
Two problems with this:
1. It's not sanitized (security)
The remark is untrusted, model-generated text captured from output and sent to PostHog analytics with no sanitization. It can carry things we don't want to ingest verbatim: secrets/API keys the model echoed from the environment, file paths or PII, prompt-injection payloads, or control/escape characters. We should sanitize before capturing — strip control chars, redact secret-shaped tokens, cap length, and validate it looks like a single reflection line rather than arbitrary content.
2. Parsing it out of prose is flaky
Marker-scanning the agent's output stream is fragile. We've already hit failure modes:
- The model echoes the ask itself instead of a real remark (fixed narrowly in #806 / the
REMARK_INSTRUCTIONecho check inremark()). - Only the first line after the marker is captured; multi-line or marker-mid-line output is dropped or truncated.
- Any change to prose formatting can silently break extraction.
As noted in the thread: parsing wizard logs/output for remarks is inherently flaky and should be reworked.
Proposed direction
Move remarks off free-text prose parsing onto a structured channel — e.g. have the agent emit the remark via a dedicated tool call / structured output field instead of an inline marker, so it arrives as a typed value we don't have to regex out of the stream. Then run whatever we receive through a sanitization pass before analytics.capture.
Acceptance criteria
- Remark content is sanitized (control chars stripped, secret-shaped tokens redacted, length-capped) before being captured to analytics.
- Remark delivery no longer depends on regex-scanning prose — it comes through a structured/typed channel.
- Echo-of-the-ask and empty/garbage remarks are reliably rejected.
- Tests cover sanitization and the new extraction path.
Context: found while debugging the Windows skill-install issue; remarks broke (#806) and Vincent flagged the parsing approach as flaky and wanting a rework.
- Ngôn ngữ chính
- TypeScript
- Star
- 208
- Fork
- 58
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 76
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PostHog/wizard
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 2 ngày
-
wizard --version prints unknown when run through npxCó thể đã có người làm @bryanlundberg đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
PostHog/wizard#1460 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Self-driving setup: checkbox labels and Confirm button overlap wrapped description textCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PostHog/wizard#986 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của PostHog/wizard
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
prio:low scope:world
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
OliverRomhagen/vrigstad-joyride#849 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
genfeedai/genfeed.ai#11916 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
erkamyaman/rust-anything#1153 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The Phase 5 report says 0.3.0 waits for the live checkCó thể đã có người làm @fzn0x đã nhận hôm nay. Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày