diff --git a/.codebuddy/github-contribute/config.md b/.codebuddy/github-contribute/config.md new file mode 100644 index 000000000..1c4123f59 --- /dev/null +++ b/.codebuddy/github-contribute/config.md @@ -0,0 +1,17 @@ +# GitHub Contribution Config — sipeed/picoclaw + +- run_mode: resume +- credential_source: session_override_env +- github_username: chengzhichao-xydt +- github_token: [session-provided] +- auth_mode: env_pat +- pat_type: classic +- max_open_prs_per_project: 5 +- max_prs_waiting_for_first_review: 3 +- tasks_per_batch: 3 +- pr_recheck_interval_minutes: 20 +- report_language: zh-CN +- report_timezone: Asia/Shanghai (UTC+8) +- default_branch_prefix: codex +- default_risk_level: low +- github_communication_language: en diff --git a/.codebuddy/github-contribute/handoff.md b/.codebuddy/github-contribute/handoff.md new file mode 100644 index 000000000..d8c3c1a24 --- /dev/null +++ b/.codebuddy/github-contribute/handoff.md @@ -0,0 +1,12 @@ +# Handoff — sipeed/picoclaw + +Last updated: 2026-06-05 08:58 UTC+8 +Run mode: resume + +## Quick Resume +- Repo: sipeed/picoclaw (fork: chengzhichao-xydt/picoclaw) +- Upstream main: 5224b9a4 +- Open PRs: #3001, #2985 +- Active branches: codex/workspace-guard-schemeless-url, codex/context-show-summarize-threshold +- Reviewer: afjcjsbx +- Next: fix both PRs per review feedback diff --git a/.codebuddy/github-contribute/journal.md b/.codebuddy/github-contribute/journal.md new file mode 100644 index 000000000..81733b1c9 --- /dev/null +++ b/.codebuddy/github-contribute/journal.md @@ -0,0 +1,11 @@ +# Journal — sipeed/picoclaw + +## 2026-06-05 08:58 UTC+8 — Resume + +- run_mode=resume confirmed +- 2 open PRs: #3001, #2985 +- Both CI green, both need code fixes from reviewer afjcjsbx +- 7 recently merged PRs +- Cleaned up merged local branches +- Initialized state directory +- Dispatching implementation sub-agents for both PRs diff --git a/.codebuddy/github-contribute/pr-board.md b/.codebuddy/github-contribute/pr-board.md new file mode 100644 index 000000000..f262e3c2a --- /dev/null +++ b/.codebuddy/github-contribute/pr-board.md @@ -0,0 +1,20 @@ +# PR Board — sipeed/picoclaw + +## awaiting_review_fix (2) + +### #3001 — fix(tools): allow scheme-less URLs in workspace guard +- Branch: codex/workspace-guard-schemeless-url +- Base: main | Created: 2026-06-04T10:06:36Z +- CI: Tests ✅ Linter ✅ Security ✅ Integration ✅ +- Review: afjcjsbx requested unit tests +- Next: implement unit tests → push → request re-review + +### #2985 — fix(context): show both summarize and compress thresholds in /context +- Branch: codex/context-show-summarize-threshold +- Base: main | Created: 2026-06-02T07:45:13Z +- CI: Tests ✅ Linter ✅ Security ✅ Integration ✅ +- Review: afjcjsbx — 3 issues: + 1. Logic misalignment in summarization threshold + 2. Hardcoded i18n text in frontend + 3. Missing test coverage +- Next: fix all 3 → push → request re-review diff --git a/.codebuddy/github-contribute/queue.md b/.codebuddy/github-contribute/queue.md new file mode 100644 index 000000000..a8564ca2f --- /dev/null +++ b/.codebuddy/github-contribute/queue.md @@ -0,0 +1,14 @@ +# Active Queue — sipeed/picoclaw + +## Active (2) + +| ID | PR | Title | Status | Action | Worker | +|----|-----|-------|--------|--------|--------| +| T1 | #3001 | fix(tools): allow scheme-less URLs in workspace guard | fix_in_place (add unit tests) | implement | pending | +| T2 | #2985 | fix(context): show both summarize and compress thresholds | fix_in_place (3 review issues) | implement | pending | + +## Merged (7) +#3000, #2999, #2996, #2995, #2992, #2991, #2986 + +## Blocked (0) +None diff --git a/pkg/agent/context_usage.go b/pkg/agent/context_usage.go index 9b9222401..ca170d20d 100644 --- a/pkg/agent/context_usage.go +++ b/pkg/agent/context_usage.go @@ -63,6 +63,13 @@ func computeContextUsage(agent *AgentInstance, sessionKey string) *bus.ContextUs // summarizeAt = soft summarization trigger: matches maybeSummarize's // threshold (contextWindow * SummarizeTokenPercent / 100). + // + // NOTE: The engine's maybeSummarize compares this threshold against + // history-message tokens only (via estimateTokens), while UsedTokens + // (shown in /context) includes system prompt, summary, and tool + // definitions on top of history tokens. A "Used > SummarizeAt" display + // does not necessarily mean summarization will fire — the engine may + // still consider the history-token budget to be under threshold. summarizeAt := contextWindow * agent.SummarizeTokenPercent / 100 if summarizeAt <= 0 { summarizeAt = compressAt diff --git a/pkg/channels/pico/pico_test.go b/pkg/channels/pico/pico_test.go index 9cdf79044..4a12f542c 100644 --- a/pkg/channels/pico/pico_test.go +++ b/pkg/channels/pico/pico_test.go @@ -602,10 +602,11 @@ func TestBeginStream_FinalizeIncludesContextUsage(t *testing.T) { t.Fatal("streamer should support FinalizeWithContext") } if err := contextStreamer.FinalizeWithContext(context.Background(), "final", &bus.ContextUsage{ - UsedTokens: 10, - TotalTokens: 100, - CompressAtTokens: 80, - UsedPercent: 10, + UsedTokens: 10, + TotalTokens: 100, + CompressAtTokens: 80, + SummarizeAtTokens: 60, + UsedPercent: 10, }); err != nil { t.Fatalf("FinalizeWithContext() error = %v", err) } @@ -627,6 +628,9 @@ func TestBeginStream_FinalizeIncludesContextUsage(t *testing.T) { if got := rawUsage["used_tokens"]; got != float64(10) { t.Fatalf("used_tokens = %#v, want 10", got) } + if got := rawUsage["summarize_at_tokens"]; got != float64(60) { + t.Fatalf("summarize_at_tokens = %#v, want 60", got) + } } func TestCreateAndAddConnection_RespectsMaxConnectionsConcurrently(t *testing.T) { diff --git a/web/frontend/src/components/chat/context-usage-ring.tsx b/web/frontend/src/components/chat/context-usage-ring.tsx index 7a33dc2fe..1a60d62c6 100644 --- a/web/frontend/src/components/chat/context-usage-ring.tsx +++ b/web/frontend/src/components/chat/context-usage-ring.tsx @@ -147,14 +147,14 @@ export function ContextUsageRing({
- Compress at + {t("chat.contextCompressAt")} {formatTokens(usage.compress_at_tokens)}
{usage.summarize_at_tokens != null && usage.summarize_at_tokens > 0 && (
- Summarize at + {t("chat.contextSummarizeAt")} {formatTokens(usage.summarize_at_tokens)} diff --git a/web/frontend/src/i18n/locales/bn-in.json b/web/frontend/src/i18n/locales/bn-in.json index c9a7249bf..97b78270f 100644 --- a/web/frontend/src/i18n/locales/bn-in.json +++ b/web/frontend/src/i18n/locales/bn-in.json @@ -96,6 +96,8 @@ "sendHint": "পাঠাতে Enter চাপুন\nনতুন লাইনের জন্য Shift + Enter", "contextTitle": "প্রসঙ্গ", "contextDetail": "বিস্তারিত দেখুন", + "contextCompressAt": "Compress at", + "contextSummarizeAt": "Summarize at", "attachImage": "ছবি যোগ করুন", "removeImage": "ছবি সরান", "uploadedImage": "আপলোড করা ছবি", diff --git a/web/frontend/src/i18n/locales/cs.json b/web/frontend/src/i18n/locales/cs.json index 30139c0b9..a399e220f 100644 --- a/web/frontend/src/i18n/locales/cs.json +++ b/web/frontend/src/i18n/locales/cs.json @@ -94,6 +94,8 @@ "sendHint": "Enter pro odeslání\nShift + Enter pro nový řádek", "contextTitle": "Kontext", "contextDetail": "Zobrazit detail", + "contextCompressAt": "Komprimovat při", + "contextSummarizeAt": "Shrnout při", "attachImage": "Přidat obrázky", "dropImagesActive": "Uvolněním přidáte obrázky", "removeImage": "Odebrat obrázek", diff --git a/web/frontend/src/i18n/locales/en.json b/web/frontend/src/i18n/locales/en.json index 11ea2cabf..201ac6145 100644 --- a/web/frontend/src/i18n/locales/en.json +++ b/web/frontend/src/i18n/locales/en.json @@ -96,6 +96,8 @@ "sendHint": "Press Enter to send\nShift + Enter for a new line", "contextTitle": "Context", "contextDetail": "View Details", + "contextCompressAt": "Compress at", + "contextSummarizeAt": "Summarize at", "attachImage": "Add images", "dropImagesActive": "Release to add images", "removeImage": "Remove image", diff --git a/web/frontend/src/i18n/locales/pt-br.json b/web/frontend/src/i18n/locales/pt-br.json index 28df583ba..29664089c 100644 --- a/web/frontend/src/i18n/locales/pt-br.json +++ b/web/frontend/src/i18n/locales/pt-br.json @@ -96,6 +96,8 @@ "sendHint": "Pressione Enter para enviar\nShift + Enter para nova linha", "contextTitle": "Contexto", "contextDetail": "Ver Detalhes", + "contextCompressAt": "Comprimir em", + "contextSummarizeAt": "Resumir em", "attachImage": "Adicionar imagens", "dropImagesActive": "Solte para adicionar imagens", "removeImage": "Remover imagem", diff --git a/web/frontend/src/i18n/locales/zh.json b/web/frontend/src/i18n/locales/zh.json index d5491e8f0..65f663040 100644 --- a/web/frontend/src/i18n/locales/zh.json +++ b/web/frontend/src/i18n/locales/zh.json @@ -96,6 +96,8 @@ "sendHint": "按 Enter 发送\nShift + Enter 换行", "contextTitle": "上下文", "contextDetail": "查看详情", + "contextCompressAt": "压缩阈值", + "contextSummarizeAt": "摘要阈值", "attachImage": "添加图片", "dropImagesActive": "松开以添加图片", "removeImage": "移除图片",