Skip to content

fix(codemode): simplify activity cards and retain command previews - #680

Merged
tt-a1i merged 2 commits into
mainfrom
codex/codemode-compact-command-preview
Oct 4, 2026
Merged

tt-a1i merged 2 commits into
mainfrom
codex/codemode-compact-command-preview

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Problem

Collapsed Code Mode cards still show script output and spill paths, hiding useful activity behind noise. They only show a few nested calls and replace the others with more calls, while running rows add status dots and repeated running labels. Long Bash commands disappear when Pi's 200-character JSON argument preview cuts through the command string; short-enough commands can instead fill a very wide terminal row.

Value

Make every recorded call visible and identifiable at a glance, using the same tool icons as ordinary OpenPI tools. Keep the default view quiet and compact horizontally, with detailed script/output evidence available through native expansion.

Approach

  • Show every recorded call once, in original order; remove recent/salient call selection and more calls placeholders.
  • Hide script output and full-output paths until expansion.
  • Reuse ordinary tool activity Codicons while retaining success, error, cancellation and unknown markers.
  • Use muted text for running cards/rows, without compact running dots or repeated running labels. Expanded evidence retains explicit running status.
  • Cap Bash command previews at 80 terminal columns, including the truncation ellipsis. Narrow terminals reduce that budget further; reserve room for status/error/timing facts. Read paths continue to follow the row width.
  • Retain the verified string prefix of Pi's native 197-character-plus-... argument previews, dropping incomplete escapes/dangling high surrogates and marking the missing suffix rather than guessing it.
  • Decode outer output JSON only when expanded; preserve raw results, terminal sanitization, native image rendering, and recorded bounded arguments.
  • Update README and renderer/native integration regression coverage.

Validation

Head: 6cd057a6d74092945e06dda57092e0bb635d467b; based on main at d96b9fcc7ed4116b090c300b103b612056e34fc3.

  • bun run check: passed on the final working tree.
  • node --test --experimental-strip-types tests/extensions/codemode-display/*.test.ts: 22 passed. The repository SDK exercises the older-host safe no-op fallback for renderer registration.
  • The same native fixture was additionally run against the locally installed Pi 1.0.2 host through a temporary import-remapping wrapper: 1 passed, exercising the public renderer resolver, pending/completed transitions, expansion and native images.
  • git diff --check: passed.
  • Coverage includes all-call ordering (5/20/100 calls), quiet muted running state, all result states, immutable native results, expanded evidence, the 80-column Bash cap for ASCII/CJK and all statuses, narrow terminals, long native argument previews, escape/Unicode truncation, failure/cancellation markers and terminal-control stripping.

Latest bun run test run: not green — 2,303 tests, 2,292 passed, 2 failed, 0 cancelled, 9 skipped. Both remaining failures are in tests/extensions/plan-mode/result-rendering.test.ts (a rich plan renders without throwing and keeps its content, expanded survives edge-content plans at extreme widths); both also failed before these changes. Other earlier runs additionally reported setup/workflow/worktree timing failures, which this change does not claim to fix. The final test-only lint adjustment replaced an expression-bodied assertion callback with a block; check and targeted/native tests were rerun afterward.

The full runner stopped on its Node-test failures, so this is not a claim that every later runner phase passed. Final interactive TUI appearance after /reload has not yet been manually verified.

Impact

  • User-visible behavior: every recorded call is shown, output/path evidence is collapsed, familiar tool icons are reused, running state is muted, Bash preview length is bounded to 80 columns.
  • Model-visible context/tools: none; native executors, schemas, permissions, model-facing results and tool activation are unchanged.
  • Runtime/lifecycle: none; presentation-only resolver, no extra hooks or execution state stores.
  • Persisted config/data: none; no new preferences or migrations.
  • Compatibility/risk: older hosts retain the native fallback. Call-card height now grows with the recorded ledger, intentionally, rather than hiding calls. Preview recovery is specific to Pi's current 200-character format and fails closed on unrecognized/malformed data. Font requirements remain the same as ordinary tool icons. Expanded nested arguments are still native bounded previews, not reconstructed full commands.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 4, 2026
@tt-a1i

tt-a1i commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

独立子代理审查

审查范围:d96b9fcc7ed4116b090c300b103b612056e34fc3 → 6cd057a6d74092945e06dda57092e0bb635d467b,覆盖本 PR 的 5 个变更文件及相关上下文。

安全、正确性与设计

  • [信息] 未发现可证实、可操作的安全漏洞、明显逻辑错误或回归问题;没有需要自动修复的条目,也没有待决策的架构/风格建议。
  • Critic 阶段无候选问题可筛选;这不等于保证不存在缺陷。

验证与覆盖限制

  • [信息] 专项测试 22 项、仓库 check、Pi 1.0.2 native wrapper smoke,以及该冻结 head 的 19 项 GitHub checks 通过,均为父代理提供的验证证据,不冒充子代理独立执行。
  • [信息] 无 .smartcr 规则库,已按无规则模式审查。AST 未产出问题,但缺少 TypeScript grammar,因此不声称 AST 覆盖通过。
  • [信息] 未独立验证真实交互 TUI 或其他宿主版本;仓库旧 SDK 的 native 测试 no-op 不能替代新宿主验证,CI 全绿也不能替代手工界面验收。

本次没有修改代码;不自动批准、不自动合并。

@tt-a1i
tt-a1i merged commit 331327e into main Oct 4, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant