惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
MyScale Blog
MyScale Blog
A
About on SuperTechFans
博客园_首页
B
Blog RSS Feed
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
I
InfoQ
罗磊的独立博客

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: filter claude autoreview streaming · openclaw/opencl...
steipete · 2026-05-27 · via Recent Commits to openclaw:main

@@ -480,7 +480,14 @@ def run_claude(args: argparse.Namespace, repo: Path, prompt: str) -> str:

480480

cmd.extend(["--model", args.model])

481481

if args.thinking:

482482

cmd.extend(["--effort", args.thinking])

483-

result = run_with_heartbeat(cmd, repo, input_text=prompt, label="claude", stream_output=args.stream_engine_output)

483+

result = run_with_heartbeat(

484+

cmd,

485+

repo,

486+

input_text=prompt,

487+

label="claude",

488+

stream_output=args.stream_engine_output,

489+

stream_display=ClaudeStreamDisplay() if args.stream_engine_output else None,

490+

)

484491

if result.returncode != 0:

485492

raise SystemExit(f"claude engine failed ({result.returncode})\n{result.stderr or result.stdout}")

486493

return result.stdout

@@ -598,6 +605,80 @@ class CodexStreamDisplay:

598605

return text

599606600607608+

class ClaudeStreamDisplay:

609+

def __init__(self, *, activity_seconds: int = 20) -> None:

610+

self.activity_seconds = activity_seconds

611+

self.hidden_events = 0

612+

self.last_visible = time.monotonic()

613+

self.started = False

614+615+

def __call__(self, name: str, line: str) -> str | None:

616+

if name != "stdout":

617+

return line

618+

try:

619+

event = json.loads(line)

620+

except json.JSONDecodeError:

621+

return self.visible(line)

622+

event_type = event.get("type")

623+

if event_type == "system" and not self.started:

624+

self.started = True

625+

return self.visible("claude turn started\n")

626+

if event_type == "assistant":

627+

return self.assistant_message(event)

628+

if event_type == "result":

629+

return self.visible(self.flush_hidden() + self.result_summary(event))

630+

return self.hidden_activity()

631+632+

def assistant_message(self, event: dict[str, Any]) -> str | None:

633+

message = event.get("message")

634+

if not isinstance(message, dict):

635+

return self.hidden_activity()

636+

chunks: list[str] = []

637+

for item in message.get("content", []):

638+

if not isinstance(item, dict):

639+

continue

640+

if item.get("type") == "text" and isinstance(item.get("text"), str):

641+

chunks.append(item["text"].rstrip())

642+

if chunks:

643+

return self.visible(self.flush_hidden() + "\n".join(chunks) + "\n")

644+

return self.hidden_activity()

645+646+

def result_summary(self, event: dict[str, Any]) -> str:

647+

usage = event.get("usage")

648+

fields: list[str] = []

649+

if isinstance(usage, dict):

650+

for key in (

651+

"input_tokens",

652+

"cache_read_input_tokens",

653+

"cache_creation_input_tokens",

654+

"output_tokens",

655+

):

656+

value = usage.get(key)

657+

if isinstance(value, int):

658+

fields.append(f"{key}={value}")

659+

cost = event.get("total_cost_usd")

660+

if isinstance(cost, (int, float)) and not isinstance(cost, bool):

661+

fields.append(f"cost_usd={cost:.6f}")

662+

return "claude usage: " + " ".join(fields) + "\n" if fields else "claude turn completed\n"

663+664+

def hidden_activity(self) -> str | None:

665+

self.hidden_events += 1

666+

if time.monotonic() - self.last_visible < self.activity_seconds:

667+

return None

668+

return self.visible(self.flush_hidden())

669+670+

def flush_hidden(self) -> str:

671+

if not self.hidden_events:

672+

return ""

673+

count = self.hidden_events

674+

self.hidden_events = 0

675+

return f"claude activity: {count} hidden tool/status events\n"

676+677+

def visible(self, text: str) -> str:

678+

self.last_visible = time.monotonic()

679+

return text

680+681+601682

def format_codex_usage(usage: dict[str, Any]) -> str:

602683

fields = [

603684

"input_tokens",

@@ -646,7 +727,7 @@ def extract_json(text: str) -> dict[str, Any]:

646727647728648729

def extract_json_from_jsonl(text: str) -> dict[str, Any] | None:

649-

candidates: list[str] = []

730+

candidates: list[str | dict[str, Any]] = []

650731

for line in text.splitlines():

651732

line = line.strip()

652733

if not line:

@@ -665,7 +746,13 @@ def extract_json_from_jsonl(text: str) -> dict[str, Any] | None:

665746

candidates.append(data["content"])

666747

if isinstance(event.get("result"), str):

667748

candidates.append(event["result"])

749+

if isinstance(event.get("structured_output"), dict):

750+

candidates.append(event["structured_output"])

668751

for candidate in reversed(candidates):

752+

if isinstance(candidate, dict):

753+

if "findings" in candidate:

754+

return candidate

755+

continue

669756

parsed = parse_json_candidate(candidate)

670757

if isinstance(parsed, dict) and "findings" in parsed:

671758

return parsed