From 2b52302dcb914c42ca46773a9a4a2559348dbd31 Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 1 Nov 2026 21:29:41 +0800 Subject: [PATCH] claude: the interactive mode takes a first message of any length @crosscn on X (11-01): after the upgrade made the interactive mode the default, a week-old conversation (a DeepSeek harness on a Claude model) got a 502, and worked again only with -p turned back on. A conversation told whole to a new interactive Claude Code is its first message, and words over 400KB were refused (claudePrint's "big", tuiPromptMost). The bound was never tried: the commit that set it lists "a ~400KB paste" under Not tried. Tried on real Claude Code 2.1.316 in a sandbox HOME, haiku: a 3MB bracketed paste showed "[Pasted text #1 +46154 lines]" after 35s; a 500KB one was sent, its transcript holds every line and the question, and the model answered it (184,168 tokens written to the cache). - tuiPromptMost and the "big" refusal are gone; claudeTUI, claudePrint, claudePrintWhy and claudeNotTUIWhy no longer take the prompt, which only that bound read. - the helper waits for a paste to show a second per 64KB longer than pasteWait (shownWait): 10s alone would press Enter while a 3MB paste was still being taken in. - the editor's tooltip says -p takes what the interactive mode can't "yet": a JSON schema (en, zh, zh-TW, ja, de). - docs/subsystems/claude-subscription-bridge.md says so. Tests: TestClaudeTUIBigFirstMessage (a ~1.1MB first message runs through the helper, 200), TestShownWaitGrowsWithThePaste; TestClaudeTUIOnRefusesPrint refuses a JSON schema now; TestClaudeTUIChosen's long-message row runs interactively. Run on mote (go1.26.8): - full go test ./internal/gateway ./internal/claudetui (-timeout 45m) at 15b035eef plus this change: claudetui ok, gateway red only on TestClaudeTUIOnRefusesPrint's -p half (the fake's "ok" fits no schema, 502); that half now checks that -p ran it, not a 200. gofmt, vet (darwin, windows) ok; claude-mode and i18n-keys GUI files 44/44 and 4/4 in chromium and webkit. - rebased on origin/main ec104b862, at the pushed tree: gofmt, vet (darwin, windows, linux -tags nogui) ok; go test -run 'Claude|Budget' ./internal/gateway ./internal/gui ok; ./internal/claudetui ok; claude-mode 44/44, i18n-keys 4/4 in both engines. - a real run through the helper (magpie built from this tree, real Claude Code 2.1.316, sandbox HOME, haiku): a 600KB first message as stream-json, answered "MANGO" in 12.5s, its transcript holding all of it. Broken by hand: the 400KB refusal put back: TestClaudeTUIBigFirstMessage red with the reporter's 502; shownWait returning pasteWait alone: TestShownWaitGrowsWithThePaste red. Not tried: the reporter's own conversation or a DeepSeek harness; a first message past the model's context (Claude Code's own error then, as with -p); a paste over 3MB; Windows or WSL with a large paste; the whole go test ./... (the gateway and claudetui packages ran whole before the rebase). --- docs/subsystems/claude-subscription-bridge.md | 11 ++++-- internal/claudetui/tui.go | 9 ++++- internal/claudetui/tui_test.go | 12 +++++++ internal/gateway/claude_mode_last_test.go | 4 +-- internal/gateway/claude_subscription.go | 34 ++++++------------- internal/gateway/claude_tui_no_print_test.go | 32 ++++++++++++++--- internal/gateway/claude_tui_test.go | 29 +++++++--------- internal/gui/assets/claudemode.js | 2 +- internal/gui/assets/i18n.js | 8 ++--- internal/gui/tests/claude-mode.test.cjs | 2 +- 10 files changed, 88 insertions(+), 55 deletions(-) diff --git a/docs/subsystems/claude-subscription-bridge.md b/docs/subsystems/claude-subscription-bridge.md index 31f6607a5..35aace644 100644 --- a/docs/subsystems/claude-subscription-bridge.md +++ b/docs/subsystems/claude-subscription-bridge.md @@ -266,12 +266,19 @@ the setting (`claudeTUIErr`, `claudeNotTUIWhy`). That is when - it is Claude Code in WSL whose home the probe didn't find, or, in the distro user's own folder, one Windows can't read (`wslread`); -- the request has a JSON schema, or words over 400KB (`tuiPromptMost`, - images not counted), which a paste can't carry; +- the request has a JSON schema; - it is a branch of a `-p` run's session (`branch`: see [Tool results another request answers first](#tool-results-another-request-answers-first)); a branch of an interactive run's session is interactive too. +A first message of any length is pasted: a conversation told whole to +a new Claude Code (one older than its session, or a client's own) can +run to megabytes. A real 3MB paste showed `[Pasted text` after 35s, and +a real 500KB one was answered with all of it in the transcript, so the +helper waits for a paste a second per 64KB longer than `pasteWait` +(`shownWait`) before its Enter. Until 11-01 words over 400KB were +refused with a 502 (`big`), a bound no paste had been tried at. + An image known only by its URL is downloaded first (`fetchURLImages`, in `serveClaudeSubscription`): the helper pastes files, where `-p`'s Claude Code had Anthropic fetch the URL. It goes diff --git a/internal/claudetui/tui.go b/internal/claudetui/tui.go index 7b4c174a2..8090cca4d 100644 --- a/internal/claudetui/tui.go +++ b/internal/claudetui/tui.go @@ -696,6 +696,13 @@ func (s *shim) pasteImage(path string, after int) (int, error) { } } +// shownWait is how long a paste of n bytes may take to show: Claude Code +// takes a long one in at about 100KB a second (a real 3MB paste showed +// "[Pasted text" after 35s), so pasteWait and a second for every 64KB. +func shownWait(n int) time.Duration { + return pasteWait + time.Duration(n/(64<<10))*time.Second +} + // shown waits for the prompt to show pasted text: its last words, or // Claude Code's "[Pasted text" for a long one. Text "" waits for nothing. func (s *shim) shown(text string) error { @@ -709,7 +716,7 @@ func (s *shim) shown(text string) error { if r := []rune(tail); len(r) > 16 { tail = string(r[len(r)-16:]) } - shownBy := time.After(pasteWait) + shownBy := time.After(shownWait(len(text))) shown: for { p := s.plain() diff --git a/internal/claudetui/tui_test.go b/internal/claudetui/tui_test.go index 66b22f35a..5fc230073 100644 --- a/internal/claudetui/tui_test.go +++ b/internal/claudetui/tui_test.go @@ -593,3 +593,15 @@ func TestShimInWSL(t *testing.T) { t.Fatalf("env %q, want %q", bun, want) } } + +// A long paste is waited for as long as Claude Code takes it in: a real +// 3MB one showed "[Pasted text" after 35s, where pasteWait alone would +// press Enter while the paste was still being taken in. +func TestShownWaitGrowsWithThePaste(t *testing.T) { + if got := shownWait(100); got != pasteWait { + t.Fatalf("a short paste: %v", got) + } + if got := shownWait(3 << 20); got < 40*time.Second { + t.Fatalf("a 3MB paste waits %v", got) + } +} diff --git a/internal/gateway/claude_mode_last_test.go b/internal/gateway/claude_mode_last_test.go index fe7c2418c..7972798cb 100644 --- a/internal/gateway/claude_mode_last_test.go +++ b/internal/gateway/claude_mode_last_test.go @@ -37,10 +37,10 @@ func TestClaudeTUICodes(t *testing.T) { claudeTUIRuns = true t.Cleanup(func() { claudeTUIRuns = was }) req := &Request{Messages: []Message{{Role: "user", Parts: []Part{{Kind: Text, Text: "hi"}}}}, Format: &Format{Type: "json_schema", Schema: []byte(`{"type":"object"}`)}} - if tui, code := claudeTUI(req, claudeCLI{path: "/usr/local/bin/claude"}, []map[string]any{{"type": "text", "text": "hi"}}); tui || code != "schema" { + if tui, code := claudeTUI(req, claudeCLI{path: "/usr/local/bin/claude"}); tui || code != "schema" { t.Fatalf("with a schema: %v %q", tui, code) } - if tui, code := claudeTUI(req, claudeCLI{}, nil); tui || code != "missing" { + if tui, code := claudeTUI(req, claudeCLI{}); tui || code != "missing" { t.Fatalf("no Claude Code: %v %q", tui, code) } } diff --git a/internal/gateway/claude_subscription.go b/internal/gateway/claude_subscription.go index b7c36296c..afbd2677d 100644 --- a/internal/gateway/claude_subscription.go +++ b/internal/gateway/claude_subscription.go @@ -926,7 +926,7 @@ func (b *subscriptionBridge) startRun(ctx context.Context, req *Request, model, // (claudeTUI): the shim (claudetui) is handed the -p arguments, and // runs them interactively. A run it can't take is refused, never made // -p: a refused request never ran, and isn't the last run - tui, code := claudeTUI(req, binary, prompt) + tui, code := claudeTUI(req, binary) if tui && binary.wsl != nil { // the helper would wait for a transcript it can't see if dir := binary.tuiWSLUnread(configDir); dir != "" { @@ -935,7 +935,7 @@ func (b *subscriptionBridge) startRun(ctx context.Context, req *Request, model, } if !tui && code != "off" && code != "no-shim" { cleanup() - return nil, nil, claudeTUIErr(claudeNotTUIWhy(req, binary, prompt, configDir)) + return nil, nil, claudeTUIErr(claudeNotTUIWhy(req, binary, configDir)) } noteClaudeRun(code) var cmd *exec.Cmd @@ -1131,11 +1131,6 @@ func (e *tuiNoStart) Unwrap() error { return e.err } // request runs as -p. var claudeTUIRuns = true -// tuiPromptMost is the longest first message a run in Claude Code's -// interactive mode is pasted, its words without its images (each pasted -// as its file's path); a longer one is refused (claudeTUIErr). -const tuiPromptMost = 400 << 10 - // claudeTUI says whether a run is Claude Code's interactive mode, as a // person runs it (claudetui), rather than -p: the plan counts a -p // request, its entrypoint sdk-cli, at about twice the interactive mode's @@ -1145,11 +1140,12 @@ const tuiPromptMost = 400 << 10 // (its home known, so its transcripts are found); not for what only -p // takes: safeguards and a client's cache marks (control requests and an // extra body), a JSON schema, and images by URL. With it on, such a run is -// refused (startRun), never made -p. prompt is the run's first message. +// refused (startRun), never made -p. A first message of any length is +// pasted (a 3MB paste was taken in 35s, a 500KB one answered whole). // The code is claudePrint's, for the provider editor's last run // (ClaudeMode.Last). -func claudeTUI(req *Request, binary claudeCLI, prompt []map[string]any) (bool, string) { - code, why := claudePrint(req, binary, prompt) +func claudeTUI(req *Request, binary claudeCLI) (bool, string) { + code, why := claudePrint(req, binary) if why != "" && code != "no-shim" { log.Printf("claude: not the interactive mode: %s", why) } @@ -1157,20 +1153,13 @@ func claudeTUI(req *Request, binary claudeCLI, prompt []map[string]any) (bool, s } // claudePrintWhy is why a run is -p, "" when it is the interactive mode. -func claudePrintWhy(req *Request, binary claudeCLI, prompt []map[string]any) string { - _, why := claudePrint(req, binary, prompt) +func claudePrintWhy(req *Request, binary claudeCLI) string { + _, why := claudePrint(req, binary) return why } // claudePrint is claudePrintWhy with a code the GUI names it by. -func claudePrint(req *Request, binary claudeCLI, prompt []map[string]any) (code, why string) { - var words []map[string]any - for _, bl := range prompt { - if bl["type"] != "image" { - words = append(words, bl) - } - } - b, _ := json.Marshal(words) +func claudePrint(req *Request, binary claudeCLI) (code, why string) { if code, why := claudeMachineWhy(binary); why != "" { return code, why } @@ -1180,7 +1169,6 @@ func claudePrint(req *Request, binary claudeCLI, prompt []map[string]any) (code, }{ {len(req.Format.schema()) > 0, "schema", "a JSON schema"}, {urlImages(req.Messages) > 0, "image", "an image known by its URL"}, - {len(b) > tuiPromptMost, "big", "a first message over 400KB"}, // a branch goes on in its session's mode: -p's prompt isn't the // interactive mode's, and the cache has the one its run asked {req.branch != nil && !req.branch.tui, "branch", "a branch of a claude -p run's session"}, @@ -1355,8 +1343,8 @@ func claudeTUIOn() bool { } // claudeNotTUIWhy is why a run isn't the interactive mode. -func claudeNotTUIWhy(req *Request, binary claudeCLI, prompt []map[string]any, configDir string) string { - if why := claudePrintWhy(req, binary, prompt); why != "" { +func claudeNotTUIWhy(req *Request, binary claudeCLI, configDir string) string { + if why := claudePrintWhy(req, binary); why != "" { return why } if binary.wsl != nil { diff --git a/internal/gateway/claude_tui_no_print_test.go b/internal/gateway/claude_tui_no_print_test.go index bca2c2a41..bbd6b1f26 100644 --- a/internal/gateway/claude_tui_no_print_test.go +++ b/internal/gateway/claude_tui_no_print_test.go @@ -2,6 +2,7 @@ package gateway import ( "context" + "net/http/httptest" "os" "path/filepath" "strings" @@ -9,6 +10,7 @@ import ( "time" "github.com/yetone/magpie/internal/claudetui" + "github.com/yetone/magpie/internal/provider" "github.com/yetone/magpie/internal/settings" "github.com/yetone/magpie/internal/testenv" ) @@ -33,9 +35,13 @@ func printMode(t *testing.T, print bool) { // 11-01). Turned off, the same request runs as -p. func TestClaudeTUIOnRefusesPrint(t *testing.T) { h, started := tuiHelperHarness(t, "") - big := strings.Repeat("the codebase as read so far. ", 15000) // over tuiPromptMost - code, msg := h.askCode("rules", big) - if code == 200 || !strings.Contains(msg, "a first message over 400KB") || !strings.Contains(msg, "never runs it as claude -p") { + body := `{"model":"claude-sonnet-5","max_tokens":100,"messages":[{"role":"user","content":"sky?"}],"output_config":{"format":{"type":"json_schema","schema":{"type":"object","properties":{"color":{"type":"string"}}}}}}` + ask := func() (int, string) { + var u Usage + return h.s.serveClaudeSubscription(httptest.NewRecorder(), httptest.NewRequest("POST", "/v1/messages", strings.NewReader(body)), provider.Anthropic, h.p, "claude-sonnet-5", []byte(body), &u) + } + code, msg := ask() + if code == 200 || !strings.Contains(msg, "a JSON schema") || !strings.Contains(msg, "never runs it as claude -p") { t.Fatalf("%d %.300s", code, msg) } if runs := h.runs(); len(runs) != 0 { @@ -45,14 +51,30 @@ func TestClaudeTUIOnRefusesPrint(t *testing.T) { t.Fatalf("the helper started %d times for a refused request", n) } printMode(t, true) - if code, msg := h.askCode("rules", big); code != 200 { - t.Fatalf("turned off, -p: %d %.300s", code, msg) + // the fake's "ok" fits no schema; what counts is that -p ran it + if _, msg := ask(); strings.Contains(msg, "never runs it as claude -p") || len(h.runs()) == 0 { + t.Fatalf("turned off, it didn't run as -p: %.300s", msg) } if n := helperStarts(started); n != 0 { t.Fatalf("turned off, the helper started %d times", n) } } +// A first message of any length runs in the interactive mode: a +// conversation of a week, told whole to a new Claude Code, was refused +// over 400KB with a 502 (@crosscn on X, 11-01), while a paste carries it +// (a real 500KB one was answered whole, a 3MB one taken in). +func TestClaudeTUIBigFirstMessage(t *testing.T) { + h, started := tuiHelperHarness(t, "") + big := strings.Repeat("the codebase as read so far. ", 40000) // ~1.1MB + if code, msg := h.askCode("rules", big); code != 200 { + t.Fatalf("%d %.300s", code, msg) + } + if n := helperStarts(started); n != 1 { + t.Fatalf("the helper started %d times, want once", n) + } +} + // With the interactive mode on, a test's or a warm-up's "hi" is said // through the interactive mode's helper, in stream-json, and its run ends // at the result; turned off, it runs as -p, with no helper. diff --git a/internal/gateway/claude_tui_test.go b/internal/gateway/claude_tui_test.go index 4d13d1935..7a6eabd08 100644 --- a/internal/gateway/claude_tui_test.go +++ b/internal/gateway/claude_tui_test.go @@ -27,29 +27,26 @@ func TestClaudeTUIChosen(t *testing.T) { text := func(s string) []Message { return []Message{{Role: "user", Parts: []Part{{Kind: Text, Text: s}}}} } - prompt := []map[string]any{{"type": "text", "text": "hi"}} on := runtime.GOOS == "darwin" || runtime.GOOS == "linux" || runtime.GOOS == "windows" cases := []struct { name string req *Request binary claudeCLI - prompt []map[string]any print bool want bool why string // what is logged, on macOS, Linux and Windows }{ - {"a plain turn", &Request{Messages: text("hi")}, here, prompt, false, on, ""}, - {"turned off", &Request{Messages: text("hi")}, here, prompt, true, false, "the interactive mode is turned off"}, - {"in WSL", &Request{Messages: text("hi")}, claudeCLI{path: "claude", wsl: &wslrun.Tool{Distro: "Ubuntu", Home: "/home/me"}}, prompt, false, on, ""}, - {"in WSL, its home unknown", &Request{Messages: text("hi")}, claudeCLI{path: "claude", wsl: &wslrun.Tool{Distro: "Ubuntu"}}, prompt, false, false, "Claude Code in WSL, its home unknown"}, - {"safeguards", &Request{Messages: text("hi"), Safeguards: json.RawMessage(`{"a":1}`)}, here, prompt, false, on, ""}, - {"client cache marks", &Request{Messages: text("hi"), clientCache: &clientCache{}}, here, prompt, false, on, ""}, - {"a schema", &Request{Messages: text("hi"), Format: &Format{Type: "json_schema", Schema: json.RawMessage(`{"type":"object"}`)}}, here, prompt, false, false, "a JSON schema"}, - {"an image", &Request{Messages: []Message{{Role: "user", Parts: []Part{{Kind: Image, MediaType: "image/png", Data: "AA=="}}}}}, here, prompt, false, on, ""}, - {"an image by its URL", &Request{Messages: []Message{{Role: "user", Parts: []Part{{Kind: Image, URL: "https://example.com/a.png"}}}}}, here, prompt, false, false, "an image known by its URL"}, - {"a tool's image by its URL", &Request{Messages: []Message{{Role: "user", Parts: []Part{{Kind: ToolResult, Images: []Part{{Kind: Image, URL: "https://example.com/a.png"}}}}}}}, here, prompt, false, false, "an image known by its URL"}, - {"a large image", &Request{Messages: text("hi")}, here, []map[string]any{{"type": "text", "text": "hi"}, {"type": "image", "source": map[string]any{"type": "base64", "data": strings.Repeat("A", tuiPromptMost)}}}, false, on, ""}, - {"a long first message", &Request{Messages: text("hi")}, here, []map[string]any{{"type": "text", "text": strings.Repeat("x", tuiPromptMost)}}, false, false, "a first message over 400KB"}, + {"a plain turn", &Request{Messages: text("hi")}, here, false, on, ""}, + {"turned off", &Request{Messages: text("hi")}, here, true, false, "the interactive mode is turned off"}, + {"in WSL", &Request{Messages: text("hi")}, claudeCLI{path: "claude", wsl: &wslrun.Tool{Distro: "Ubuntu", Home: "/home/me"}}, false, on, ""}, + {"in WSL, its home unknown", &Request{Messages: text("hi")}, claudeCLI{path: "claude", wsl: &wslrun.Tool{Distro: "Ubuntu"}}, false, false, "Claude Code in WSL, its home unknown"}, + {"safeguards", &Request{Messages: text("hi"), Safeguards: json.RawMessage(`{"a":1}`)}, here, false, on, ""}, + {"client cache marks", &Request{Messages: text("hi"), clientCache: &clientCache{}}, here, false, on, ""}, + {"a schema", &Request{Messages: text("hi"), Format: &Format{Type: "json_schema", Schema: json.RawMessage(`{"type":"object"}`)}}, here, false, false, "a JSON schema"}, + {"an image", &Request{Messages: []Message{{Role: "user", Parts: []Part{{Kind: Image, MediaType: "image/png", Data: "AA=="}}}}}, here, false, on, ""}, + {"an image by its URL", &Request{Messages: []Message{{Role: "user", Parts: []Part{{Kind: Image, URL: "https://example.com/a.png"}}}}}, here, false, false, "an image known by its URL"}, + {"a tool's image by its URL", &Request{Messages: []Message{{Role: "user", Parts: []Part{{Kind: ToolResult, Images: []Part{{Kind: Image, URL: "https://example.com/a.png"}}}}}}}, here, false, false, "an image known by its URL"}, + {"a long first message", &Request{Messages: text(strings.Repeat("the codebase as read so far. ", 40000))}, here, false, on, ""}, } for _, c := range cases { st := settings.Load() @@ -57,10 +54,10 @@ func TestClaudeTUIChosen(t *testing.T) { if err := settings.Save(st); err != nil { t.Fatal(err) } - if got, _ := claudeTUI(c.req, c.binary, c.prompt); got != c.want { + if got, _ := claudeTUI(c.req, c.binary); got != c.want { t.Errorf("%s: claudeTUI = %v, want %v", c.name, got, c.want) } - if got := claudePrintWhy(c.req, c.binary, c.prompt); on && got != c.why { + if got := claudePrintWhy(c.req, c.binary); on && got != c.why { t.Errorf("%s: -p because %q, want %q", c.name, got, c.why) } } diff --git a/internal/gui/assets/claudemode.js b/internal/gui/assets/claudemode.js index bd4bafb34..9527d0c55 100644 --- a/internal/gui/assets/claudemode.js +++ b/internal/gui/assets/claudemode.js @@ -38,7 +38,7 @@ function ccTip(anchor, tui) { t("Your plan counts these requests as Claude Code's own use, at about half of the 5-hour allowance that -p uses for the same work.")), mode(!tui, "claude -p", t("Claude Code's print mode, the one scripts and the Agent SDK use: a request in, its reply out."), - t("It starts at once, and takes what the interactive mode can't: a JSON schema, a first message over 400KB."), + t("It starts at once, and takes what the interactive mode can't yet: a JSON schema."), t("The plan counts a -p request at about twice the interactive mode's.")), el("div", "foot", t("Switched here or in Settings › Models › Replies. With the interactive mode on, nothing ever runs as -p: a request it can't take, or one it fails to start for, fails saying why."))); document.body.append(tip); diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index f31f691fa..6ef78e951 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -12,7 +12,7 @@ const I18N = { "magpie opens Claude Code as a person does, in a terminal of its own that you don't see, types each request in and reads the reply from its transcript.": "magpie 像人一样打开 Claude Code:在一个你看不到的终端里输入每个请求,再从它的会话记录里读出回复。", "Your plan counts these requests as Claude Code's own use, at about half of the 5-hour allowance that -p uses for the same work.": "套餐把这些请求算作 Claude Code 自身的使用,同样的工作只消耗 -p 约一半的 5 小时额度。", "Claude Code's print mode, the one scripts and the Agent SDK use: a request in, its reply out.": "Claude Code 的打印模式,脚本和 Agent SDK 用的就是它:一个请求进去,一个回复出来。", - "It starts at once, and takes what the interactive mode can't: a JSON schema, a first message over 400KB.": "启动即用,并且支持交互模式做不到的:JSON schema、超过 400KB 的第一条消息。", + "It starts at once, and takes what the interactive mode can't yet: a JSON schema.": "启动即用,并且支持交互模式暂时做不到的:JSON schema。", "The plan counts a -p request at about twice the interactive mode's.": "套餐对 -p 请求的计量约为交互模式的两倍。", "Switched here or in Settings › Models › Replies. With the interactive mode on, nothing ever runs as -p: a request it can't take, or one it fails to start for, fails saying why.": "可在这里或 设置 › 模型 › 回复 里切换。开着交互模式时,任何请求都不会走 -p:交互模式接不了或启动失败的请求会报错并说明原因。", "Every request runs as claude -p": "每个请求都以 claude -p 运行", @@ -4379,7 +4379,7 @@ const I18N = { "magpie opens Claude Code as a person does, in a terminal of its own that you don't see, types each request in and reads the reply from its transcript.": "magpie 像人一樣開啟 Claude Code:在一個你看不到的終端機裡輸入每個請求,再從它的對話記錄讀出回覆。", "Your plan counts these requests as Claude Code's own use, at about half of the 5-hour allowance that -p uses for the same work.": "方案把這些請求算作 Claude Code 本身的使用,同樣的工作只消耗 -p 約一半的 5 小時額度。", "Claude Code's print mode, the one scripts and the Agent SDK use: a request in, its reply out.": "Claude Code 的列印模式,腳本和 Agent SDK 用的就是它:一個請求進去,一個回覆出來。", - "It starts at once, and takes what the interactive mode can't: a JSON schema, a first message over 400KB.": "啟動即用,並且支援互動模式做不到的:JSON schema、超過 400KB 的第一則訊息。", + "It starts at once, and takes what the interactive mode can't yet: a JSON schema.": "啟動即用,並且支援互動模式暫時做不到的:JSON schema。", "The plan counts a -p request at about twice the interactive mode's.": "方案對 -p 請求的計量約為互動模式的兩倍。", "Switched here or in Settings › Models › Replies. With the interactive mode on, nothing ever runs as -p: a request it can't take, or one it fails to start for, fails saying why.": "可在這裡或 設定 › 模型 › 回覆 裡切換。開著互動模式時,任何請求都不會走 -p:互動模式接不了或啟動失敗的請求會報錯並說明原因。", "Every request runs as claude -p": "每個請求都以 claude -p 執行", @@ -8731,7 +8731,7 @@ const I18N = { "magpie opens Claude Code as a person does, in a terminal of its own that you don't see, types each request in and reads the reply from its transcript.": "magpie は人と同じように Claude Code を開きます。見えない専用のターミナルで各リクエストを入力し、トランスクリプトから応答を読み取ります。", "Your plan counts these requests as Claude Code's own use, at about half of the 5-hour allowance that -p uses for the same work.": "プランはこれらのリクエストを Claude Code 自身の利用として数え、同じ作業で -p の約半分の 5 時間枠しか使いません。", "Claude Code's print mode, the one scripts and the Agent SDK use: a request in, its reply out.": "Claude Code の print モードで、スクリプトや Agent SDK が使うものです。リクエストを渡し、応答を受け取ります。", - "It starts at once, and takes what the interactive mode can't: a JSON schema, a first message over 400KB.": "すぐに起動し、対話モードにできないものも扱えます:JSON schema、400KB を超える最初のメッセージ。", + "It starts at once, and takes what the interactive mode can't yet: a JSON schema.": "すぐに起動し、対話モードにまだできないものも扱えます:JSON schema。", "The plan counts a -p request at about twice the interactive mode's.": "プランは -p のリクエストを対話モードの約 2 倍として数えます。", "Switched here or in Settings › Models › Replies. With the interactive mode on, nothing ever runs as -p: a request it can't take, or one it fails to start for, fails saying why.": "ここか 設定 › モデル › 応答 で切り替えられます。対話モードがオンのときは、何も -p では実行しません。対話モードで扱えないリクエストや起動に失敗したリクエストは理由を添えてエラーになります。", "Every request runs as claude -p": "すべてのリクエストを claude -p で実行します", @@ -13085,7 +13085,7 @@ const I18N = { "magpie opens Claude Code as a person does, in a terminal of its own that you don't see, types each request in and reads the reply from its transcript.": "magpie öffnet Claude Code wie ein Mensch, in einem eigenen Terminal, das du nicht siehst, tippt jede Anfrage ein und liest die Antwort aus dem Transkript.", "Your plan counts these requests as Claude Code's own use, at about half of the 5-hour allowance that -p uses for the same work.": "Dein Plan zählt diese Anfragen als Claude Codes eigene Nutzung, mit etwa der Hälfte des 5-Stunden-Kontingents, das -p für dieselbe Arbeit braucht.", "Claude Code's print mode, the one scripts and the Agent SDK use: a request in, its reply out.": "Der Print-Modus von Claude Code, den Skripte und das Agent SDK nutzen: eine Anfrage hinein, ihre Antwort heraus.", - "It starts at once, and takes what the interactive mode can't: a JSON schema, a first message over 400KB.": "Er startet sofort und kann, was der interaktive Modus nicht kann: ein JSON-Schema, eine erste Nachricht über 400 KB.", + "It starts at once, and takes what the interactive mode can't yet: a JSON schema.": "Er startet sofort und kann, was der interaktive Modus noch nicht kann: ein JSON-Schema.", "The plan counts a -p request at about twice the interactive mode's.": "Der Plan zählt eine -p-Anfrage etwa doppelt so hoch wie eine im interaktiven Modus.", "Switched here or in Settings › Models › Replies. With the interactive mode on, nothing ever runs as -p: a request it can't take, or one it fails to start for, fails saying why.": "Hier oder unter Einstellungen › Modelle › Antworten umschaltbar. Mit eingeschaltetem interaktivem Modus läuft nie etwas als -p: Eine Anfrage, die er nicht annehmen kann oder für die er nicht startet, schlägt mit dem Grund fehl.", "Every request runs as claude -p": "Jede Anfrage läuft als claude -p", diff --git a/internal/gui/tests/claude-mode.test.cjs b/internal/gui/tests/claude-mode.test.cjs index d7b1bf510..606410ba9 100644 --- a/internal/gui/tests/claude-mode.test.cjs +++ b/internal/gui/tests/claude-mode.test.cjs @@ -124,7 +124,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", ]); // nothing in the card says a request falls back to -p (the owner, 11-01) assert.equal((await tip.locator(".foot").textContent()).trim(), await tr("Switched here or in Settings › Models › Replies. With the interactive mode on, nothing ever runs as -p: a request it can't take, or one it fails to start for, fails saying why.")); - assert.equal((await tip.locator(".cc-m").nth(1).locator("p.good").textContent()).trim(), await tr("It starts at once, and takes what the interactive mode can't: a JSON schema, a first message over 400KB.")); + assert.equal((await tip.locator(".cc-m").nth(1).locator("p.good").textContent()).trim(), await tr("It starts at once, and takes what the interactive mode can't yet: a JSON schema.")); const box = await tip.boundingBox(); assert(box.x >= 0 && box.y >= 0 && box.x + box.width <= width && box.y + box.height <= 760, `the card is inside the window: ${JSON.stringify(box)}`); if (lang !== "en") {