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
|
// summarizeAt = soft summarization trigger: matches maybeSummarize's
|
||||||
// threshold (contextWindow * SummarizeTokenPercent / 100).
|
// 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
|
summarizeAt := contextWindow * agent.SummarizeTokenPercent / 100
|
||||||
if summarizeAt <= 0 {
|
if summarizeAt <= 0 {
|
||||||
summarizeAt = compressAt
|
summarizeAt = compressAt
|
||||||
|
|||||||
@@ -605,6 +605,7 @@ func TestBeginStream_FinalizeIncludesContextUsage(t *testing.T) {
|
|||||||
UsedTokens: 10,
|
UsedTokens: 10,
|
||||||
TotalTokens: 100,
|
TotalTokens: 100,
|
||||||
CompressAtTokens: 80,
|
CompressAtTokens: 80,
|
||||||
|
SummarizeAtTokens: 60,
|
||||||
UsedPercent: 10,
|
UsedPercent: 10,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
t.Fatalf("FinalizeWithContext() error = %v", err)
|
t.Fatalf("FinalizeWithContext() error = %v", err)
|
||||||
@@ -627,6 +628,9 @@ func TestBeginStream_FinalizeIncludesContextUsage(t *testing.T) {
|
|||||||
if got := rawUsage["used_tokens"]; got != float64(10) {
|
if got := rawUsage["used_tokens"]; got != float64(10) {
|
||||||
t.Fatalf("used_tokens = %#v, want 10", got)
|
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) {
|
func TestCreateAndAddConnection_RespectsMaxConnectionsConcurrently(t *testing.T) {
|
||||||
|
|||||||
@@ -147,14 +147,14 @@ export function ContextUsageRing({
|
|||||||
|
|
||||||
<div className="mt-2 space-y-0.5">
|
<div className="mt-2 space-y-0.5">
|
||||||
<div className="flex items-center justify-between text-[10px]">
|
<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">
|
<span className="tabular-nums">
|
||||||
{formatTokens(usage.compress_at_tokens)}
|
{formatTokens(usage.compress_at_tokens)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{usage.summarize_at_tokens != null && usage.summarize_at_tokens > 0 && (
|
{usage.summarize_at_tokens != null && usage.summarize_at_tokens > 0 && (
|
||||||
<div className="flex items-center justify-between text-[10px]">
|
<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">
|
<span className="tabular-nums">
|
||||||
{formatTokens(usage.summarize_at_tokens)}
|
{formatTokens(usage.summarize_at_tokens)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -96,6 +96,8 @@
|
|||||||
"sendHint": "পাঠাতে Enter চাপুন\nনতুন লাইনের জন্য Shift + Enter",
|
"sendHint": "পাঠাতে Enter চাপুন\nনতুন লাইনের জন্য Shift + Enter",
|
||||||
"contextTitle": "প্রসঙ্গ",
|
"contextTitle": "প্রসঙ্গ",
|
||||||
"contextDetail": "বিস্তারিত দেখুন",
|
"contextDetail": "বিস্তারিত দেখুন",
|
||||||
|
"contextCompressAt": "Compress at",
|
||||||
|
"contextSummarizeAt": "Summarize at",
|
||||||
"attachImage": "ছবি যোগ করুন",
|
"attachImage": "ছবি যোগ করুন",
|
||||||
"removeImage": "ছবি সরান",
|
"removeImage": "ছবি সরান",
|
||||||
"uploadedImage": "আপলোড করা ছবি",
|
"uploadedImage": "আপলোড করা ছবি",
|
||||||
|
|||||||
@@ -94,6 +94,8 @@
|
|||||||
"sendHint": "Enter pro odeslání\nShift + Enter pro nový řádek",
|
"sendHint": "Enter pro odeslání\nShift + Enter pro nový řádek",
|
||||||
"contextTitle": "Kontext",
|
"contextTitle": "Kontext",
|
||||||
"contextDetail": "Zobrazit detail",
|
"contextDetail": "Zobrazit detail",
|
||||||
|
"contextCompressAt": "Komprimovat při",
|
||||||
|
"contextSummarizeAt": "Shrnout při",
|
||||||
"attachImage": "Přidat obrázky",
|
"attachImage": "Přidat obrázky",
|
||||||
"dropImagesActive": "Uvolněním přidáte obrázky",
|
"dropImagesActive": "Uvolněním přidáte obrázky",
|
||||||
"removeImage": "Odebrat obrázek",
|
"removeImage": "Odebrat obrázek",
|
||||||
|
|||||||
@@ -96,6 +96,8 @@
|
|||||||
"sendHint": "Press Enter to send\nShift + Enter for a new line",
|
"sendHint": "Press Enter to send\nShift + Enter for a new line",
|
||||||
"contextTitle": "Context",
|
"contextTitle": "Context",
|
||||||
"contextDetail": "View Details",
|
"contextDetail": "View Details",
|
||||||
|
"contextCompressAt": "Compress at",
|
||||||
|
"contextSummarizeAt": "Summarize at",
|
||||||
"attachImage": "Add images",
|
"attachImage": "Add images",
|
||||||
"dropImagesActive": "Release to add images",
|
"dropImagesActive": "Release to add images",
|
||||||
"removeImage": "Remove image",
|
"removeImage": "Remove image",
|
||||||
|
|||||||
@@ -96,6 +96,8 @@
|
|||||||
"sendHint": "Pressione Enter para enviar\nShift + Enter para nova linha",
|
"sendHint": "Pressione Enter para enviar\nShift + Enter para nova linha",
|
||||||
"contextTitle": "Contexto",
|
"contextTitle": "Contexto",
|
||||||
"contextDetail": "Ver Detalhes",
|
"contextDetail": "Ver Detalhes",
|
||||||
|
"contextCompressAt": "Comprimir em",
|
||||||
|
"contextSummarizeAt": "Resumir em",
|
||||||
"attachImage": "Adicionar imagens",
|
"attachImage": "Adicionar imagens",
|
||||||
"dropImagesActive": "Solte para adicionar imagens",
|
"dropImagesActive": "Solte para adicionar imagens",
|
||||||
"removeImage": "Remover imagem",
|
"removeImage": "Remover imagem",
|
||||||
|
|||||||
@@ -96,6 +96,8 @@
|
|||||||
"sendHint": "按 Enter 发送\nShift + Enter 换行",
|
"sendHint": "按 Enter 发送\nShift + Enter 换行",
|
||||||
"contextTitle": "上下文",
|
"contextTitle": "上下文",
|
||||||
"contextDetail": "查看详情",
|
"contextDetail": "查看详情",
|
||||||
|
"contextCompressAt": "压缩阈值",
|
||||||
|
"contextSummarizeAt": "摘要阈值",
|
||||||
"attachImage": "添加图片",
|
"attachImage": "添加图片",
|
||||||
"dropImagesActive": "松开以添加图片",
|
"dropImagesActive": "松开以添加图片",
|
||||||
"removeImage": "移除图片",
|
"removeImage": "移除图片",
|
||||||
|
|||||||
Reference in New Issue
Block a user