You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "me2seeks (via GitHub)" <gi...@apache.org> on 2026/08/25 04:04:08 UTC
[PR] feat(tui): add side conversation switching [maka]
me2seeks opened a new pull request, #3760:
URL: https://github.com/apache/maka/pull/3760
## Summary
Completes TUI side conversations with retained switching and Host-backed parent status.
- Adds terminal-compatible `Ctrl+/` switching for legacy and Kitty keyboard protocols.
- Preserves independent unsent drafts for the parent and side views.
- Keeps running Turns alive when switching views.
- Projects the parent Session’s authoritative Host state while the side is visible.
- Uses English-only status copy, including:
- `Side from main thread · Ctrl+/ to switch · Ctrl+C to close`
- `Ctrl+/ for side`
- actionable and terminal `main …` variants
- Closes and recoverably removes the retained side when navigating outside the pair.
- Stops an active side Turn before removal when the pair is discarded.
- Keeps model, permission, thinking, and orchestration settings as creation-time copies that evolve independently afterward.
Fixes #3746
## Verification
- `npm run lint`
- `npm run format:check`
- `npm run typecheck`
- `npm --workspace maka-agent run build`
- `npm --workspace maka-agent run test:dist` — 452 passed
- `npm run check:asf-headers`
- `npx knip --workspace packages/cli` — reports only the existing `dev-cli.ts` and five existing exported-type findings; no changed file is reported
Relevant behavior evidence:
```text
✔ Ctrl+/ toggles side views, preserves drafts, and projects parent status in English
✔ Ctrl+/ detaches from a running side Turn without stopping it
✔ /session outside the pair discards its retained side conversation
✔ observes actionable and terminal parent status from the Host projection
✔ renders side conversation status in English for every UI locale
```
## Review focus
This PR is stacked on #3759. Because the head branch lives in a fork, GitHub requires this upstream PR to target `main`; until #3759 merges, the Files changed view also includes the lifecycle commit.
The background observer reuses the existing Runtime Host continuity channel. It does not introduce a second lifecycle authority or persist TUI projection state. Historical terminal Turns are suppressed so `main finished` only describes a parent Turn observed running while the side was open.
## AI use
Select exactly one:
- [ ] No generative tool made a substantive contribution
- [x] Generative tooling made a substantive contribution
Tool(s) and scope: Codex implemented terminal key normalization, switching, draft isolation, Host status projection, cleanup integration, tests, and first-principles, adversarial, and simplification reviews.
## Checklist
- [x] Tests cover the change and fail without it
- [x] Lint, format, typecheck and the affected suites pass locally
Does this PR entail a change in behavior?
- [x] Yes — described under Summary above
- [ ] No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] feat(tui): add side conversation switching [maka]
Posted by "M4n5ter (via GitHub)" <gi...@apache.org>.
M4n5ter commented on PR #3760:
URL: https://github.com/apache/maka/pull/3760#issuecomment-5426156794
**[P2] Preserve the editor's undo shortcut when no side conversation exists.**
The raw input listener currently consumes every byte matched by `matchesSideConversationToggle()` before the editor receives it (`packages/cli/src/pi-tui-runner.ts:3595-3598`). On legacy terminals, `Ctrl+/`, `Ctrl+_`, and the editor's default undo binding `Ctrl+-` all arrive as `0x1f`. The helper therefore treats the editor's undo key as a side-view toggle even when `sideConversation` is undefined; `toggleSideConversation()` returns immediately, but the event has already been consumed.
A probe against the shipped `@earendil-works/pi-tui` 0.84.2 editor confirmed the path: after typing `draft`, delivering `0x1f` to the editor restores the previous empty snapshot, while the new listener classifies and consumes that same byte first. This affects ordinary TUI editing for every legacy-terminal user, not only users who open `/side`. The current side-switching tests send `0x1f` only after a pair exists, so they do not cover the regression.
Please intercept the ambiguous legacy byte only while a side pair exists. Outside that state it must fall through to the editor. Add a regression that types a normal draft without opening `/side`, sends `0x1f`, and verifies that undo still works. While a side pair is active, the legacy encoding cannot distinguish the two shortcuts, so retaining the documented toggle there is a reasonable explicit tradeoff.
<details><summary>简体中文</summary>
**[P2] 没有 side conversation 时,应保留编辑器的撤销快捷键。**
当前原始输入监听器会在编辑器收到按键前,无条件吞掉 `matchesSideConversationToggle()` 匹配的字节(`packages/cli/src/pi-tui-runner.ts:3595-3598`)。在传统终端中,`Ctrl+/`、`Ctrl+_` 和编辑器默认的撤销键 `Ctrl+-` 都编码成 `0x1f`。因此,即使 `sideConversation` 不存在,撤销键也会被当成 side view 切换键;`toggleSideConversation()` 随后直接返回,但按键已经丢失。
使用项目当前的 `@earendil-works/pi-tui` 0.84.2 做探针验证:输入 `draft` 后,把 `0x1f` 交给编辑器会恢复之前的空快照;新增监听器却会先识别并吞掉同一字节。该回归影响所有使用传统终端的普通 TUI 编辑场景,并不只影响打开 `/side` 的用户。现有测试只在 side pair 已存在时发送 `0x1f`,因此无法发现此问题。
请仅在 side pair 存在时拦截这个含义有歧义的传统终端字节;其他状态应让它继续传给编辑器。请补一个回归测试:不打开 `/side`,输入普通草稿后发送 `0x1f`,确认撤销仍生效。side pair 已打开时,传统编码无法区分两个快捷键,继续保留已公开的切换行为是合理且明确的取舍。
</details>
---
_Posted by an automated review agent operated by @M4n5ter. This is not an
independent human review and does not satisfy the committer review required by
CONTRIBUTING.md. A human is accountable for this comment — please push back if
anything here is wrong._
<details><summary>简体中文</summary>
_本条评论由 @M4n5ter 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。_
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] feat(tui): add side conversation switching [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #3760:
URL: https://github.com/apache/maka/pull/3760
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] feat(tui): add side conversation switching [maka]
Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks commented on PR #3760:
URL: https://github.com/apache/maka/pull/3760#issuecomment-5420610192
Addressed both review findings in `69a941a9b`:
- Restores the retained parent draft after the parent switch succeeds and before the side pair is discarded. The regression covers `/side` → `Ctrl+/` → type parent draft → `Ctrl+/` → empty-side `Ctrl+C`.
- Treats parent observer open failure and exhausted transport recovery as unknown status instead of the factual `closed` state. A genuinely archived parent still renders `main closed`; regressions cover both initial-open failure and retry exhaustion.
Validation: root build; CLI tests 466/466; lint; format; ASF headers; `git diff --check`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] feat(tui): add side conversation switching [maka]
Posted by "me2seeks (via GitHub)" <gi...@apache.org>.
me2seeks commented on PR #3760:
URL: https://github.com/apache/maka/pull/3760#issuecomment-5426412764
Fixed in follow-up #3929. The ambiguous legacy byte now falls through to the editor until a side pair exists; the new regression proves `Ctrl+-` undo without `/side`, while the existing active-side toggle coverage remains.
_Posted by Codex on behalf of @me2seeks._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org