mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
fix(context): address review - clarify threshold alignment, i18n strings, add test coverage
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -147,14 +147,14 @@ export function ContextUsageRing({
|
||||
|
||||
<div className="mt-2 space-y-0.5">
|
||||
<div className="flex items-center justify-between text-[10px]">
|
||||
<span className="text-muted-foreground">Compress at</span>
|
||||
<span className="text-muted-foreground">{t("chat.contextCompressAt")}</span>
|
||||
<span className="tabular-nums">
|
||||
{formatTokens(usage.compress_at_tokens)}
|
||||
</span>
|
||||
</div>
|
||||
{usage.summarize_at_tokens != null && usage.summarize_at_tokens > 0 && (
|
||||
<div className="flex items-center justify-between text-[10px]">
|
||||
<span className="text-muted-foreground">Summarize at</span>
|
||||
<span className="text-muted-foreground">{t("chat.contextSummarizeAt")}</span>
|
||||
<span className="tabular-nums">
|
||||
{formatTokens(usage.summarize_at_tokens)}
|
||||
</span>
|
||||
|
||||
@@ -96,6 +96,8 @@
|
||||
"sendHint": "পাঠাতে Enter চাপুন\nনতুন লাইনের জন্য Shift + Enter",
|
||||
"contextTitle": "প্রসঙ্গ",
|
||||
"contextDetail": "বিস্তারিত দেখুন",
|
||||
"contextCompressAt": "Compress at",
|
||||
"contextSummarizeAt": "Summarize at",
|
||||
"attachImage": "ছবি যোগ করুন",
|
||||
"removeImage": "ছবি সরান",
|
||||
"uploadedImage": "আপলোড করা ছবি",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -96,6 +96,8 @@
|
||||
"sendHint": "按 Enter 发送\nShift + Enter 换行",
|
||||
"contextTitle": "上下文",
|
||||
"contextDetail": "查看详情",
|
||||
"contextCompressAt": "压缩阈值",
|
||||
"contextSummarizeAt": "摘要阈值",
|
||||
"attachImage": "添加图片",
|
||||
"dropImagesActive": "松开以添加图片",
|
||||
"removeImage": "移除图片",
|
||||
|
||||
Reference in New Issue
Block a user