Python
fix(gui): Steps panel fixes from the second in-app check (OPE-244)
Devika Verma8bf0c8874aa1
diff --git a/surfaces/gui/src/components/StepsPanel.test.tsx b/surfaces/gui/src/components/StepsPanel.test.tsxindex cfff3890..2cefdb2e 100644--- a/surfaces/gui/src/components/StepsPanel.test.tsx+++ b/surfaces/gui/src/components/StepsPanel.test.tsx@@ -109,6 +109,113 @@ describe("StepsPanel", () => {expect(screen.queryByTestId("steps-details")).toBeNull();});+ it("badges rows the way the mock does", async () => {+ // Round-2 in-app check: a failed shell command, a failed or unreported model call, a+ // shadow check, an Inbox wait and an auto-approved action each say so on their row.+ vi.mocked(getRecordedTurns).mockResolvedValue([turn] as any);+ vi.mocked(getTurnSteps).mockResolvedValue([+ step({ step_id: "e1", kind: "tool", name: "run_shell", attrs: { exit_code: 3 } }),+ step({ step_id: "e2", kind: "model", name: "model", status: "error", attrs: { purpose: "title", error: { type: "provider_error" }, usage: { reported: false } } }),+ step({ step_id: "e3", kind: "model", name: "model", status: "error", attrs: { purpose: "main", error: { type: "context_length" }, usage: { reported: false } } }),+ step({ step_id: "e4", kind: "model", name: "model", attrs: { purpose: "main", usage: { reported: false } } }),+ step({ step_id: "e5", kind: "auto_approver", name: "write_file", shadow: true, attrs: { result: "allow", mode: "shadow" } }),+ step({ step_id: "e6", kind: "wait", name: "approval", attrs: { kind: "approval", where: "inbox", outcome: "approved" } }),+ step({ step_id: "e7", kind: "tool", name: "run_shell", attrs: { exit_code: 0, decision: { origin: "reviewer", path: [] } } }),+ step({ step_id: "e8", kind: "tool", name: "write_file", status: "denied", attrs: {} }),+ ] as any);+ render(<StepsPanel sessionId="s1" onClose={() => {}} />);+ await waitFor(() => expect(screen.getAllByTestId("steps-row")).toHaveLength(8));+ const labels = screen.getAllByTestId("steps-row").map((r) => r.textContent);+ expect(labels[0]).toContain("exit 3");+ expect(labels[1]).toContain("failed · provider error");+ expect(labels[2]).toContain("over the context limit");+ expect(labels[3]).toContain("no usage");+ expect(labels[4]).toContain("Shadow check · would have allowed");+ expect(labels[5]).toContain("Waiting · parked in Inbox · approval");+ expect(labels[6]).toContain("auto-approved");+ expect(labels[7]).toContain("refused");+ });++ it("shows what the context held, a tool's result size and a model call's ids", async () => {+ const ctx = step({ step_id: "c", kind: "context", name: "context", duration_ms: 0, attrs: {+ session_prompt_hash: "42070c", size_chars: 1057, block_hash: "69a95b",+ session_start: { memories: ["m1", "m2"], memory_mode: "index", rules: 1, agents_md: 1 },+ per_turn: { folders: 2, mode_note: "plan", sandbox_note: true, skills_menu: 3, skills_hash: "ab12cd" } } });+ const tool = step({ step_id: "t", kind: "tool", name: "read_file", call_id: "call-9", attrs: { result_bytes: 2048 } });+ const model = step({ step_id: "m", kind: "model", name: "model", attrs: { purpose: "main", usage: { reported: true },+ provider_facts: { provider_request_id: "req_1", provider_response_id: "resp_1" } } });+ vi.mocked(getRecordedTurns).mockResolvedValue([turn] as any);+ vi.mocked(getTurnSteps).mockResolvedValue([ctx, model, tool] as any);+ vi.mocked(getStepDetail).mockImplementation(async (_s, id) => ({ c: ctx, m: { ...model, exchange_rebuilt: [{ request: {}, response: "" }, { request: {}, response: "" }, { auxiliary: true, request: {}, response: "" }] }, t: tool } as any)[id]);+ render(<StepsPanel sessionId="s1" onClose={() => {}} />);+ await waitFor(() => expect(screen.getAllByTestId("steps-row")).toHaveLength(3));+ fireEvent.click(screen.getAllByTestId("steps-row")[0]);+ let d = (await screen.findByTestId("steps-details")).textContent || "";+ for (const s of ["Memories2 · as an index", "Your rules1", "AGENTS.md files1", "Folders2", "Mode noteplan", "Skills offered3 · ab12cd", "1057 · 69a95b"]) expect(d).toContain(s);+ fireEvent.click(screen.getAllByTestId("steps-row")[1]);+ await waitFor(() => expect(screen.getByTestId("steps-details").textContent).toContain("req_1"));+ d = screen.getByTestId("steps-details").textContent || "";+ expect(d).toContain("resp_1");+ expect(d).toContain("Attempts2"); // the auxiliary lookup is not an attempt+ fireEvent.click(screen.getAllByTestId("steps-row")[2]);+ await waitFor(() => expect(screen.getByTestId("steps-details").textContent).toContain("2.0 KB"));+ expect(screen.getByTestId("steps-details").textContent).toContain("call-9");+ });++ it("shows the context size when the window is not known", async () => {+ vi.mocked(getRecordedTurns).mockResolvedValue([turn] as any);+ vi.mocked(getTurnSteps).mockResolvedValue(steps as any);+ vi.mocked(getRecordedUsage).mockResolvedValue({+ pill: 10, at_least: false, unreported_calls: 0, failed_calls: 0, overflow_calls: 0, cache_share: 0,+ by_purpose: { main: 10 }, totals: { input: 9, cache: 0, output: 1 }, by_model_parts: {},+ context: { tokens: 6837, window: null },+ });+ render(<StepsPanel sessionId="s1" onClose={() => {}} />);+ fireEvent.click(await screen.findByRole("tab", { name: "Usage" }));+ expect((await screen.findByTestId("steps-usage")).textContent).toContain("6.8k (window not known)");+ });++ it("says which steps were still running when the app stopped", async () => {+ // TD-12: a turn found open at start is closed as unknown; its open steps have no time.+ vi.mocked(getRecordedTurns).mockResolvedValue([{ ...turn, status: "unknown", duration_ms: null }] as any);+ vi.mocked(getTurnSteps).mockResolvedValue([+ step({ step_id: "m", kind: "model", name: "model", attrs: { purpose: "main", usage: { reported: true } } }),+ step({ step_id: "g", kind: "notice", name: "recording_gap", duration_ms: 0 }),+ step({ step_id: "w", kind: "wait", name: "approval", status: "unknown", duration_ms: null, attrs: { kind: "approval", where: "inbox" } }),+ ] as any);+ render(<StepsPanel sessionId="s1" onClose={() => {}} />);+ expect((await screen.findByTestId("steps-gap")).textContent).toContain("1 step was still running when OpenWorker stopped");+ const labels = screen.getAllByTestId("steps-row").map((r) => r.textContent);+ expect(labels[1]).toContain("Recording gap");+ expect(labels[2]).toContain("unknown");+ expect(labels[2]).toContain("—");+ });++ it("opens another session at its newest turn", async () => {+ // Round-2 in-app check: switching sessions with the panel open kept the old turn+ // position ("Turn 1 of 2" instead of the newest).+ vi.mocked(getRecordedTurns).mockImplementation(async (sid) =>+ (sid === "a" ? [turn, { ...turn, turn_id: "t2", seq: 2 }] : [turn, { ...turn, turn_id: "t2", seq: 2 }, { ...turn, turn_id: "t3", seq: 3 }]) as any);+ vi.mocked(getTurnSteps).mockResolvedValue(steps as any);+ const { rerender } = render(<StepsPanel sessionId="a" onClose={() => {}} />);+ await screen.findByText("Turn 2 of 2");+ fireEvent.click(screen.getByRole("button", { name: "Previous turn" }));+ await screen.findByText("Turn 1 of 2");+ rerender(<StepsPanel sessionId="b" onClose={() => {}} />);+ await screen.findByText("Turn 3 of 3");+ });++ it("lists a decision model's answers", async () => {+ const check = step({ step_id: "q", kind: "auto_approver", name: "run_shell", attrs: { result: "unsure", mode: "live", reviewer: { kind: "openai_decisions" } },+ content: { reason: "requested 0.98 but unrelated_destination 0.99", questions: [{ name: "requested", answer: "yes", score: 0.98 }, { name: "unrelated_destination", answer: "yes", score: 0.99 }] } });+ vi.mocked(getRecordedTurns).mockResolvedValue([turn] as any);+ vi.mocked(getTurnSteps).mockResolvedValue([check] as any);+ vi.mocked(getStepDetail).mockResolvedValue(check as any);+ render(<StepsPanel sessionId="s1" onClose={() => {}} />);+ fireEvent.click((await screen.findAllByTestId("steps-row"))[0]);+ expect((await screen.findByTestId("steps-questions")).textContent).toContain("unrelated_destination: yes (0.99)");+ });+it("says when a session has no recorded steps", async () => {vi.mocked(getRecordedTurns).mockResolvedValue([]);render(<StepsPanel sessionId="old" onClose={() => {}} />);diff --git a/surfaces/gui/src/components/StepsPanel.tsx b/surfaces/gui/src/components/StepsPanel.tsxindex c2cebe86..7a4865d0 100644--- a/surfaces/gui/src/components/StepsPanel.tsx+++ b/surfaces/gui/src/components/StepsPanel.tsx@@ -28,6 +28,12 @@ export function formatDuration(ms: number | null | undefined): string {return s ? `${m}m ${s}s` : `${m}m`;}+function formatBytes(n: number): string {+ if (n < 1024) return `${n} B`;+ if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;+ return `${(n / 1024 / 1024).toFixed(1)} MB`;+}+/** The row's label, as the mock writes it: "Model · summary", "Auto-approver · allowed"… */export function stepLabel(step: RecordedStep, t: (k: string, o?: any) => string): string {const a = step.attrs || {};@@ -39,9 +45,14 @@ export function stepLabel(step: RecordedStep, t: (k: string, o?: any) => string)return t("steps.row.model") + purpose;}case "wait":- return `${t("steps.row.wait")} · ${t(`steps.wait.${a.kind}`, { defaultValue: a.kind || "" })}`;- case "auto_approver":- return `${t("steps.row.auto_approver")} · ${t(`steps.result.${a.result}`, { defaultValue: a.result || "" })}`;+ return `${a.where === "inbox" ? t("steps.row.wait_inbox") : t("steps.row.wait")} · ${t(`steps.wait.${a.kind}`, { defaultValue: a.kind || "" })}`;+ case "auto_approver": {+ const result = step.status === "error" ? "could_not_run" : a.result;+ if (step.shadow && result !== "could_not_run") {+ return `${t("steps.row.shadow")} · ${t(`steps.would.${result}`, { defaultValue: result || "" })}`;+ }+ return `${t("steps.row.auto_approver")} · ${t(`steps.result.${result}`, { defaultValue: result || "" })}`;+ }case "summary": {const before = a.tokens_before, after = a.tokens_after;const arrow = before != null && after != null ? ` · ${formatTokens(before)}→${formatTokens(after)}` : "";@@ -54,6 +65,41 @@ export function stepLabel(step: RecordedStep, t: (k: string, o?: any) => string)}}+type Flag = { cls: "err" | "warn" | "info"; text: string };++/** The row's badges, as the mock draws them: why a call failed, a refused or failed tool,+ * a call with no token counts, an auto-approved action, a step after the turn. */+export function stepFlags(step: RecordedStep, t: (k: string, o?: any) => string): Flag[] {+ const a = step.attrs || {};+ const flags: Flag[] = [];+ if (step.kind === "model") {+ if (a.error) {+ flags.push(a.error.type === "context_length"+ ? { cls: "warn", text: t("steps.flag.over_limit") }+ : { cls: "err", text: t("steps.flag.failed", { type: t(`steps.error_type.${a.error.type}`, { defaultValue: a.error.type }) }) });+ } else if (step.status === "interrupted") {+ flags.push({ cls: "err", text: t("steps.status.interrupted") });+ } else if (a.usage && !a.usage.reported) {+ flags.push({ cls: "warn", text: t("steps.flag.no_usage") });+ }+ } else if (step.kind === "tool") {+ if (a.exit_code != null && a.exit_code !== 0 && step.status !== "denied") {+ flags.push({ cls: "err", text: t("steps.flag.exit", { code: a.exit_code }) });+ } else if (["error", "denied", "interrupted", "skipped", "unknown"].includes(step.status)) {+ flags.push({ cls: "err", text: t(`steps.status.${step.status}`) });+ }+ if (a.sandbox?.blocked_count > 0) flags.push({ cls: "err", text: t("steps.flag.blocked") });+ if (a.decision?.origin === "reviewer") flags.push({ cls: "info", text: t("steps.flag.auto_approved") });+ } else if (step.kind === "auto_approver") {+ if (step.status === "interrupted") flags.push({ cls: "err", text: t("steps.status.interrupted") });+ } else if (["error", "denied", "interrupted", "skipped", "unknown"].includes(step.status)) {+ flags.push({ cls: "err", text: t(`steps.status.${step.status}`) });+ }+ if (step.kind === "model" && step.status === "unknown") flags.push({ cls: "warn", text: t("steps.status.unknown") });+ if (step.after_turn) flags.push({ cls: "info", text: t("steps.after_turn") });+ return flags;+}+/** Steps in canonical order, each nested child right under its parent. */function nest(steps: RecordedStep[]): { step: RecordedStep; depth: number }[] {const ids = new Set(steps.map((s) => s.step_id));@@ -89,6 +135,11 @@ export function StepsPanel({const [selected, setSelected] = useState<string | null>(null);const [error, setError] = useState(false);+ // Another session: start again at its newest turn.+ useEffect(() => {+ setTurnIdx(null);+ setSteps([]);+ }, [sessionId]);useEffect(() => {let live = true;getRecordedTurns(sessionId)@@ -146,6 +197,11 @@ export function StepsPanel({))}{turn.buckets.other_shown && <Tile value={formatDuration(turn.buckets.other)} label={t("steps.bucket.other")} />}</div>+ {steps.some((s) => s.status === "unknown") && (+ <p className="steps-line" data-testid="steps-gap">+ {t("steps.unknown_line", { count: steps.filter((s) => s.status === "unknown").length })}+ </p>+ )}{checks.length > 0 && (<p className="steps-line" data-testid="steps-checks">{t("steps.checks_line", {@@ -200,7 +256,6 @@ function StepRow({ step, depth, turn, label, selected, onSelect }: {const total = Math.max(1, turn.buckets.total || turn.duration_ms || 1);const left = Math.min(100, Math.max(0, ((step.started_at - turn.started_at) / total) * 100));const width = step.duration_ms ? Math.min(100 - left, (step.duration_ms / total) * 100) : 0;- const bad = ["error", "denied", "interrupted", "skipped"].includes(step.status);return (<buttonclassName={`steps-row kind-${step.kind}` + (selected ? " selected" : "") + (step.shadow ? " shadow" : "")}@@ -211,8 +266,9 @@ function StepRow({ step, depth, turn, label, selected, onSelect }: {<span className="steps-dot" /><span className="steps-label">{label}- {bad && <span className={`steps-badge ${step.status}`}>{t(`steps.status.${step.status}`)}</span>}- {step.after_turn && <span className="steps-badge">{t("steps.after_turn")}</span>}+ {stepFlags(step, t).map((f) => (+ <span key={f.text} className={`steps-badge ${f.cls}`}>{f.text}</span>+ ))}</span><span className="steps-track"><span className="steps-bar" style={{ left: `${left}%`, width: width ? `${width}%` : undefined }} />@@ -246,24 +302,57 @@ function StepDetails({ sessionId, stepId, turn }: { sessionId: string; stepId: sif (a.finish_reason) rows.push([t("steps.detail.stopped"), a.finish_reason]);if (a.tools_offered) rows.push([t("steps.detail.tools"), `${a.tools_offered} · ${a.tools_hash || ""}`]);if (turn.stamp?.persona_fp) rows.push([t("steps.detail.coworker"), `ⓕ${turn.stamp.persona_fp}`]);- if (a.error) rows.push([t("steps.detail.error"), `${a.error.type}${a.error.text ? ` · ${a.error.text}` : ""}`]);+ const facts = a.provider_facts || {};+ if (facts.provider_request_id) rows.push([t("steps.detail.request_id"), facts.provider_request_id]);+ if (facts.provider_response_id) rows.push([t("steps.detail.response_id"), facts.provider_response_id]);+ const attempts = (d.exchange_rebuilt || []).filter((x: any) => !x.auxiliary).length;+ if (attempts > 1) rows.push([t("steps.detail.attempts"), attempts]);+ if (a.error) rows.push([t("steps.detail.error"), `${t(`steps.error_type.${a.error.type}`, { defaultValue: a.error.type })}${a.error.text ? ` · ${a.error.text}` : ""}`]);}if (d.kind === "tool") {- if (a.risk_class) rows.push([t("steps.detail.risk"), a.risk_class]);+ if (a.risk_class) rows.push([t("steps.detail.risk"), t(`steps.risk.${a.risk_class}`, { defaultValue: a.risk_class })]);if (a.exit_code != null) rows.push([t("steps.detail.exit"), a.exit_code]);+ if (a.result_bytes != null) rows.push([t("steps.detail.result_size"), formatBytes(a.result_bytes)]);if (a.decision?.origin) rows.push([t("steps.detail.origin"), t(`steps.origin.${a.decision.origin}`, { defaultValue: a.decision.origin })]);if (a.sandbox) rows.push([t("steps.detail.blocked"), a.sandbox.blocked_known ? a.sandbox.blocked_count : t("steps.detail.unknown")]);+ if (d.call_id) rows.push([t("steps.detail.call_id"), d.call_id]);}if (d.kind === "wait") {- rows.push([t("steps.detail.where"), a.where], [t("steps.detail.outcome"), a.outcome]);+ rows.push([t("steps.detail.where"), t(`steps.where.${a.where}`, { defaultValue: a.where })],+ [t("steps.detail.outcome"), a.outcome == null ? null : t(`steps.outcome.${a.outcome}`, { defaultValue: a.outcome })]);if (d.content?.resolved_by) rows.push([t("steps.detail.answered_by"), d.content.resolved_by]);}if (d.kind === "auto_approver") {- rows.push([t("steps.detail.mode"), a.mode], [t("steps.detail.reviewer"), a.reviewer?.model || a.reviewer?.kind]);+ rows.push([t("steps.detail.mode"), t(`steps.check_mode.${a.mode}`, { defaultValue: a.mode })], [t("steps.detail.reviewer"), a.reviewer?.model || a.reviewer?.kind]);+ if (a.breaker) {+ rows.push([t("steps.detail.breaker"), a.breaker.tripped ? t("steps.detail.breaker_tripped", { n: a.breaker.denials_in_row })+ : String(a.breaker.denials_in_row ?? 0)]);+ }+ if (a.matched_user != null) rows.push([t("steps.detail.matched_user"), a.matched_user ? t("steps.detail.yes") : t("steps.detail.no")]);if (d.content?.reason) rows.push([t("steps.detail.reason"), d.content.reason]);}+ if (d.kind === "summary") {+ if (a.reason) rows.push([t("steps.detail.summary_reason"), t(`steps.summary_reason.${a.reason}`, { defaultValue: a.reason })]);+ rows.push([t("steps.detail.tokens_before"), a.tokens_before == null ? "—" : formatTokens(a.tokens_before)],+ [t("steps.detail.tokens_after"), a.tokens_after == null ? "—" : formatTokens(a.tokens_after)]);+ }if (d.kind === "context") {- rows.push([t("steps.detail.session_prompt"), a.session_prompt_hash || "—"], [t("steps.detail.size"), a.size_chars]);+ rows.push([t("steps.detail.session_prompt"), a.session_prompt_hash || "—"]);+ }+ // What the context held: the context step, and a "context changed" notice (the block now).+ if (d.kind === "context" || (d.kind === "notice" && d.name === "context_changed")) {+ const start = a.session_start, pt = a.per_turn;+ if (start) {+ rows.push([t("steps.detail.memories"), `${(start.memories || []).length}${start.memory_mode === "index" ? ` · ${t("steps.detail.as_index")}` : ""}`]);+ rows.push([t("steps.detail.rules"), start.rules ?? 0], [t("steps.detail.agents_md"), start.agents_md ?? 0]);+ }+ if (pt) {+ rows.push([t("steps.detail.folders"), pt.folders ?? 0]);+ if (pt.mode_note) rows.push([t("steps.detail.mode_note"), pt.mode_note]);+ rows.push([t("steps.detail.skills"), pt.skills_menu ? `${pt.skills_menu} · ${pt.skills_hash || ""}` : 0]);+ rows.push([t("steps.detail.sandbox_note"), pt.sandbox_note ? t("steps.detail.yes") : t("steps.detail.no")]);+ }+ if (a.size_chars != null) rows.push([t("steps.detail.size"), `${a.size_chars} · ${a.block_hash || "—"}`]);}const u = a.usage;return (@@ -291,10 +380,17 @@ function StepDetails({ sessionId, stepId, turn }: { sessionId: string; stepId: s)}</div>)}+ {Array.isArray(d.content?.questions) && d.content.questions.length > 0 && (+ <ol className="steps-path" data-testid="steps-questions">+ {d.content.questions.map((q: any) => (+ <li key={q.name}>{q.name}: {t(`steps.detail.${q.answer === "yes" ? "yes" : "no"}`)}{q.score != null ? ` (${q.score.toFixed(2)})` : ""}</li>+ ))}+ </ol>+ )}{a.decision?.path && (<ol className="steps-path">{a.decision.path.map((p: any, i: number) => (- <li key={i}>{t(`steps.stage.${p.stage}`, { defaultValue: p.stage })}: {p.outcome}{p.detail ? ` (${p.detail})` : ""}</li>+ <li key={i}>{t(`steps.stage.${p.stage}`, { defaultValue: p.stage })}: {t(`steps.outcome.${p.outcome}`, { defaultValue: p.outcome })}{p.detail ? ` (${t(`steps.origin.${p.detail}`, { defaultValue: p.detail })})` : ""}</li>))}</ol>)}@@ -353,13 +449,18 @@ function UsageView({ sessionId, refreshKey }: { sessionId: string; refreshKey: n))}</tbody></table>- {u.context && u.context.window && (+ {u.context && u.context.window ? (<><h4>{t("steps.usage.context_now")}</h4><div className="steps-purpose-bar wide"><span style={{ width: `${Math.min(100, (u.context.tokens / u.context.window) * 100)}%` }} /></div><p className="steps-line">{t("steps.usage.context_line", { used: formatTokens(u.context.tokens), window: formatTokens(u.context.window) })}</p></>- )}+ ) : u.context?.tokens ? (+ <>+ <h4>{t("steps.usage.context_now")}</h4>+ <p className="steps-line">{t("steps.usage.context_no_window", { used: formatTokens(u.context.tokens) })}</p>+ </>+ ) : null}</div>);}diff --git a/surfaces/gui/src/locales/en.json b/surfaces/gui/src/locales/en.jsonindex e651d0df..737be490 100644--- a/surfaces/gui/src/locales/en.json+++ b/surfaces/gui/src/locales/en.json@@ -3061,13 +3061,31 @@},"checks_line_one": "Auto-approve: {{count}} check · {{allowed}} allowed · {{asked}} asked you · {{blocked}} blocked","checks_line_other": "Auto-approve: {{count}} checks · {{allowed}} allowed · {{asked}} asked you · {{blocked}} blocked",+ "unknown_line_one": "{{count}} step was still running when OpenWorker stopped; its time is unknown.",+ "unknown_line_other": "{{count}} steps were still running when OpenWorker stopped; their times are unknown.","row": {"context": "Context built","model": "Model","wait": "Waiting for you","auto_approver": "Auto-approver","summary": "Summary",- "trim": "Trim"+ "trim": "Trim",+ "wait_inbox": "Waiting · parked in Inbox",+ "shadow": "Shadow check"+ },+ "would": {+ "allow": "would have allowed",+ "deny": "would have blocked",+ "unsure": "would have asked",+ "context_changed": "would have asked (changed while checking)"+ },+ "flag": {+ "failed": "failed · {{type}}",+ "over_limit": "over the context limit",+ "no_usage": "no usage",+ "exit": "exit {{code}}",+ "blocked": "blocked by sandbox",+ "auto_approved": "auto-approved"},"purpose": {"main": "main",@@ -3147,7 +3165,94 @@"reason": "Reason","coworker": "Coworker fingerprint","session_prompt": "Session prompt",- "size": "Context block size"+ "size": "Context block size",+ "request_id": "Request id",+ "response_id": "Response id",+ "attempts": "Attempts",+ "result_size": "Result size",+ "call_id": "Call id",+ "breaker": "Refusals in a row",+ "breaker_tripped": "{{n}} · paused",+ "matched_user": "Same as your answer",+ "yes": "yes",+ "no": "no",+ "summary_reason": "Why",+ "tokens_before": "Context before",+ "tokens_after": "Context after",+ "memories": "Memories",+ "as_index": "as an index",+ "rules": "Your rules",+ "agents_md": "AGENTS.md files",+ "folders": "Folders",+ "mode_note": "Mode note",+ "skills": "Skills offered",+ "sandbox_note": "Sandbox note"+ },+ "summary_reason": {+ "threshold": "reached the compaction size",+ "overflow": "the model said the conversation was too long"+ },+ "outcome": {+ "allowed": "allowed",+ "needs_user": "needs you",+ "human_only": "only a person may approve",+ "denied": "denied",+ "config_allowlist": "your allowlist",+ "session_grant": "allowed for this session",+ "standing_rule": "a standing rule",+ "trusted_rule": "your trust rule",+ "trusted_server": "server trust",+ "run_grant": "allowed for this request",+ "suspended_in_auto_approve": "held for you in Auto-approve",+ "allow_anyway": "you chose Allow anyway",+ "lead_denial": "the lead's denial",+ "readonly_tier": "read-only command",+ "gate_tier": "safe change",+ "allow": "allowed",+ "deny": "blocked",+ "unsure": "asked you",+ "could_not_run": "could not run",+ "context_changed": "changed while checking",+ "skipped_human_only": "skipped (a person must decide)",+ "skipped_unattended": "skipped (nobody watching)",+ "skipped_paused": "skipped (auto-approve paused)",+ "skipped_off": "skipped (auto-approve off)",+ "shown_session": "shown in the session",+ "parked_inbox": "parked in the Inbox",+ "auto_refused": "refused automatically (attendance auto)",+ "approved_once": "approved once",+ "approved_session": "allowed for this session",+ "approved_run": "allowed for this request",+ "approved_always": "always allowed",+ "interrupted": "stopped",+ "superseded": "already answered elsewhere",+ "approved": "approved",+ "answered": "answered"+ },+ "where": {+ "session": "in the session",+ "inbox": "in the Inbox"+ },+ "check_mode": {+ "live": "decides",+ "shadow": "shadow (advice only)"+ },+ "risk": {+ "read": "read",+ "egress": "network",+ "write_local": "local change",+ "exec": "runs commands",+ "external": "outside service"+ },+ "error_type": {+ "context_length": "too long",+ "overloaded": "provider overloaded",+ "rate_limited": "rate limited",+ "auth": "key or sign-in refused",+ "network": "network",+ "timeout": "timed out",+ "provider_error": "provider error",+ "cancelled": "cancelled"},"origin": {"low_risk": "low risk",@@ -3166,7 +3271,13 @@"reviewer_denied": "the auto-approver","unattended_auto": "attendance auto","readonly_tier": "read-only command",- "gate_tier": "safe change"+ "gate_tier": "safe change",+ "always_tool": "this tool",+ "always_command": "this command",+ "always_domain": "this site",+ "always_site": "this site, kept in the sandbox list",+ "readonly_session": "read-only commands",+ "cleared_by_mode": "the mode"},"stage": {"permission": "Permission",@@ -3192,6 +3303,7 @@"out": "Out","context_now": "Context now","context_line": "{{used}} of {{window}}",+ "context_no_window": "{{used}} (window not known)","unreported_one": "{{count}} call did not report usage","unreported_other": "{{count}} calls did not report usage","failed_one": "{{count}} failed call (usage unknown)",diff --git a/surfaces/gui/src/locales/zh.json b/surfaces/gui/src/locales/zh.jsonindex 7177014b..eb86b7f0 100644--- a/surfaces/gui/src/locales/zh.json+++ b/surfaces/gui/src/locales/zh.json@@ -3016,13 +3016,31 @@"other": "其他"},"checks_line_other": "自动审批:{{count}} 次检查 · {{allowed}} 次允许 · {{asked}} 次询问你 · {{blocked}} 次阻止",+ "unknown_line_one": "{{count}} 个步骤在 OpenWorker 停止时仍在运行,其用时未知。",+ "unknown_line_other": "{{count}} 个步骤在 OpenWorker 停止时仍在运行,其用时未知。","row": {"context": "构建上下文","model": "模型","wait": "等待你","auto_approver": "自动审批","summary": "摘要",- "trim": "裁剪"+ "trim": "裁剪",+ "wait_inbox": "等待 · 已放入收件箱",+ "shadow": "影子检查"+ },+ "would": {+ "allow": "本会允许",+ "deny": "本会阻止",+ "unsure": "本会询问你",+ "context_changed": "本会询问你(检查时内容已变)"+ },+ "flag": {+ "failed": "失败 · {{type}}",+ "over_limit": "超出上下文上限",+ "no_usage": "未报告用量",+ "exit": "退出码 {{code}}",+ "blocked": "被沙箱阻止",+ "auto_approved": "已自动批准"},"purpose": {"main": "主要",@@ -3102,7 +3120,94 @@"reason": "原因","coworker": "协作者指纹","session_prompt": "会话提示词",- "size": "上下文块大小"+ "size": "上下文块大小",+ "request_id": "请求 ID",+ "response_id": "响应 ID",+ "attempts": "尝试次数",+ "result_size": "结果大小",+ "call_id": "调用 ID",+ "breaker": "连续拒绝次数",+ "breaker_tripped": "{{n}} · 已暂停",+ "matched_user": "与你的答复一致",+ "yes": "是",+ "no": "否",+ "summary_reason": "原因",+ "tokens_before": "压缩前上下文",+ "tokens_after": "压缩后上下文",+ "memories": "记忆",+ "as_index": "以索引形式",+ "rules": "你的规则",+ "agents_md": "AGENTS.md 文件",+ "folders": "文件夹",+ "mode_note": "模式说明",+ "skills": "提供的技能",+ "sandbox_note": "沙箱说明"+ },+ "summary_reason": {+ "threshold": "达到压缩阈值",+ "overflow": "模型提示对话过长"+ },+ "outcome": {+ "allowed": "已允许",+ "needs_user": "需要你确认",+ "human_only": "只能由人批准",+ "denied": "已拒绝",+ "config_allowlist": "你的允许列表",+ "session_grant": "本会话已允许",+ "standing_rule": "常设规则",+ "trusted_rule": "你的信任规则",+ "trusted_server": "服务器信任",+ "run_grant": "本次请求已允许",+ "suspended_in_auto_approve": "自动审批中留给你决定",+ "allow_anyway": "你选择了仍然允许",+ "lead_denial": "负责人拒绝",+ "readonly_tier": "只读命令",+ "gate_tier": "安全更改",+ "allow": "已允许",+ "deny": "已阻止",+ "unsure": "询问了你",+ "could_not_run": "无法运行",+ "context_changed": "检查期间有变化",+ "skipped_human_only": "已跳过(必须由人决定)",+ "skipped_unattended": "已跳过(无人值守)",+ "skipped_paused": "已跳过(自动审批已暂停)",+ "skipped_off": "已跳过(自动审批已关闭)",+ "shown_session": "在会话中显示",+ "parked_inbox": "已放入收件箱",+ "auto_refused": "已自动拒绝(自动值守)",+ "approved_once": "批准一次",+ "approved_session": "本会话已允许",+ "approved_run": "本次请求已允许",+ "approved_always": "始终允许",+ "interrupted": "已停止",+ "superseded": "已在别处答复",+ "approved": "已批准",+ "answered": "已回答"+ },+ "where": {+ "session": "在会话中",+ "inbox": "在收件箱中"+ },+ "check_mode": {+ "live": "直接决定",+ "shadow": "影子模式(仅建议)"+ },+ "risk": {+ "read": "读取",+ "egress": "网络访问",+ "write_local": "本地更改",+ "exec": "运行命令",+ "external": "外部服务"+ },+ "error_type": {+ "context_length": "过长",+ "overloaded": "服务商过载",+ "rate_limited": "频率受限",+ "auth": "密钥或登录被拒绝",+ "network": "网络",+ "timeout": "超时",+ "provider_error": "服务商错误",+ "cancelled": "已取消"},"origin": {"low_risk": "低风险",@@ -3121,7 +3226,13 @@"reviewer_denied": "自动审批","unattended_auto": "自动值守","readonly_tier": "只读命令",- "gate_tier": "安全更改"+ "gate_tier": "安全更改",+ "always_tool": "此工具",+ "always_command": "此命令",+ "always_domain": "此站点",+ "always_site": "此站点(保存在沙箱列表中)",+ "readonly_session": "只读命令",+ "cleared_by_mode": "当前模式"},"stage": {"permission": "权限",@@ -3146,6 +3257,7 @@"out": "输出","context_now": "当前上下文","context_line": "{{used}} / {{window}}",+ "context_no_window": "{{used}}(窗口大小未知)","unreported_other": "{{count}} 次调用没有报告用量","failed_other": "{{count}} 次调用失败(用量未知)","overflow_other": "{{count}} 次调用超出上下文上限,对话已被摘要"diff --git a/surfaces/gui/src/styles.css b/surfaces/gui/src/styles.cssindex 734c9916..7a179bfe 100644--- a/surfaces/gui/src/styles.css+++ b/surfaces/gui/src/styles.css@@ -2452,8 +2452,8 @@ html[data-platform="linux"] ::-webkit-scrollbar-thumb:hover { background-color:.steps-row.kind-wait .steps-bar { background:repeating-linear-gradient(135deg,var(--line-strong) 0 4px,transparent 4px 8px); }.steps-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.steps-badge { margin-left:6px; padding:1px 6px; border-radius:6px; font-size:var(--fs-label); background:var(--chrome-hover); color:var(--muted); }-.steps-badge.error,.steps-badge.denied { background:color-mix(in srgb,#dc2626 14%,transparent); color:#b91c1c; }-.steps-badge.interrupted,.steps-badge.skipped { background:color-mix(in srgb,#d97706 16%,transparent); color:#b45309; }+.steps-badge.err { background:color-mix(in srgb,#dc2626 14%,transparent); color:#b91c1c; }+.steps-badge.warn { background:color-mix(in srgb,#d97706 16%,transparent); color:#b45309; }.steps-track { position:relative; height:10px; border-left:1px solid var(--line); }.steps-bar { position:absolute; top:1px; height:8px; min-width:3px; border-radius:3px; background:var(--faint); }.steps-time { text-align:right; color:var(--muted); font-size:var(--fs-meta); font-variant-numeric:tabular-nums; }@@ -2467,6 +2467,15 @@ html[data-platform="linux"] ::-webkit-scrollbar-thumb:hover { background-color:.steps-path { margin:6px 0; padding-left:18px; color:var(--muted); font-size:var(--fs-meta); }.steps-pre { margin:8px 0 0; padding:8px 10px; max-height:240px; overflow:auto; background:var(--chrome-hover); border-radius:6px; font-size:var(--fs-meta); white-space:pre-wrap; overflow-wrap:anywhere; }.steps-exchange summary { margin-top:8px; cursor:pointer; color:var(--muted); font-size:var(--fs-meta); }+/* A narrow rail (phone width, or a small window): stack each detail's label above its value,+ two tiles a row, and a shorter time track, so nothing wraps one letter per line. */+.steps-panel { container-type:inline-size; }+@container (max-width: 360px) {+ .steps-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }+ .steps-row { grid-template-columns:10px minmax(0,1fr) 40px 44px; gap:6px; }+ .steps-details dl div { grid-template-columns:minmax(0,1fr); gap:0; }+ .steps-body { padding:10px 10px 16px; }+}.steps-purpose { display:grid; grid-template-columns:minmax(0,1fr) 64px 90px; gap:8px; align-items:center; padding:6px 0; border-bottom:1px solid var(--line); font-size:var(--fs-ui); }.steps-purpose > span:nth-child(2) { text-align:right; font-variant-numeric:tabular-nums; }.steps-purpose-bar { height:6px; border-radius:3px; background:var(--chrome-hover); overflow:hidden; display:block; }