Skip to content

Fix hybrid Tab history popup behind shell predictions - #444

Open
WilliamWang1721 wants to merge 4 commits into
Kuddev:mainfrom
WilliamWang1721:codex/issue-358-hybrid-completion
Open

WilliamWang1721 wants to merge 4 commits into
Kuddev:mainfrom
WilliamWang1721:codex/issue-358-hybrid-completion

Conversation

@WilliamWang1721

@WilliamWang1721 WilliamWang1721 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Result / 用户结果

Hybrid Tab now opens Pebrel's history list when a native shell prediction occupies the cells after the cursor, rather than sending Tab to PowerShell's path completer. Closes #358.

Design / 设计边界

Reuse the existing prompt parser with a guarded, explicit-Tab prefix snapshot. The whole typed mirror must match the echoed input, and a prior strict snapshot must have established that it was at the input end. Cursor/history/control edits invalidate that trust; a stale frame cannot restore it. Requested popups retain the snapshot across redraws. Normal capture and command submission keep their strict tail checks; PSReadLine settings stay intact. No dependency, persistence or protocol changes.

Evidence / 验证依据

Two self-review passes completed. New GPUI regressions exercise the production parser, asynchronous history calculation and actual Tab/Enter routing with an unaccepted gray prediction, plus Home/Up/Ctrl-R and stale-frame negatives. Opening writes no PTY input; accepting writes only the candidate suffix.

Final head 69a9a6c18d19e0fae918bbd6289e6f7b87ede4b8: all required PR checks passed. Upstream native validation executed the Linux, Windows x64 and Windows ARM64 suites. macOS native execution was not selected by repository policy. No manual Windows/pwsh visual acceptance or real PSReadLine reproduction is claimed.

AI implementation/review: GPT-6.1 SOL sub-agents; coordinator model and reasoning efforts unverified.

Required Review / 必须确认

  • Followed contributing, architecture and project constraints; reused existing ownership.
  • Architecture, formatting, selected native regressions and every required check passed for the final head.
  • Regression boundaries and unverified platform behavior are stated; no new UI messages or governance changes.

@Kuddev

Kuddev commented Oct 5, 2026

Copy link
Copy Markdown
Owner

合并就绪核查:当前提交 69a9a6c 与 main 70a99fe 在 nebula_app/src/display/input_state.rs 和 nebula_app/src/gpui_shell/terminal/view/completion.rs 有内容冲突(git merge-tree 已确认)。需与现有补齐/输入状态实现语义对齐后重新验证 native-prediction、Home/Up/Ctrl-R 和 stale-frame 回归;旧 head 的绿灯不代表当前整合通过。本轮保留原 PR 代码,没有自动选取任一侧覆盖冲突。

@Kuddev

Kuddev commented Oct 5, 2026

Copy link
Copy Markdown
Owner

当前 main 的补全输入已由 query_completion_editor / completion_editor 快照优先处理,和本 PR 的旧基线不同。请先同步 main,处理 input_state.rs 与 terminal/view/completion.rs 的冲突,再提供窄范围修正。

不要直接把旧版 handle_completion_key 覆盖回来:本 PR 新增的提前返回逻辑需要保持原生 editor 查询、查询期间按键处理、取消及过期结果检查的优先级;也不要仅凭键击镜像新增第二份输入真值。请保留“预测尾巴不是已输入文本”“Tab 开列表不向 PTY 写入”“光标编辑/历史召回后不误接受”的现有回归,并在有 editor snapshot 与无 snapshot 两种入口上验证。

目前只确认它需要按新输入合同重新整合,不认定所有报告场景已被 main 覆盖。该项由作者调整后再复审,维护者继续优先合入边界较小的修复。

@Kuddev

Kuddev commented Oct 6, 2026

Copy link
Copy Markdown
Owner

补充本轮复核证据,当前仍是 69a9a6c,尚未同步主线。

因此请先在当前 main 上证明剩余失败场景,再将补丁缩到确实需要的分支,尤其区分“原生 editor 已广告并可查询”和“没有原生快照”的回退。不要把旧基线开头的提前返回直接放在当前查询/取消状态机之前。

同时澄清验证口径:原生编辑器查询控制序列可以进入 PTY;禁止的是把展开列表的 Tab 当普通输入传下去,或在候选加载/展开时提交命令。无原生编辑器的受控回退场景才适合断言完全没有 PTY 输入。保留预测文本隔离、Home/Up/Ctrl-R、过期帧及取消回归。

@Kuddev Kuddev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前 head 7ae16b8 的 handle_completion_key 仍在原生编辑器查询与 pending 状态处理之前,新增了基于键击镜像的 Tab 提前返回。main 已通过 #504 修正 WSL 查询及菜单刷新,这条旧入口需要先与新的输入所有权和取消/过期规则对齐。

请同步当前 main,并把镜像回退限制在没有可用原生快照的明确场景;已广告原生编辑器或有查询在途时仍走主线权威查询,不抢先用镜像计算。补上有/无 editor capability、查询在途重复 Tab、预测尾巴、Home/Up/Ctrl-R、取消和过期帧的验证。现有新测试主要构造无原生编辑器的回退场景,尚不足以覆盖这条提前返回对主线查询链的影响。

旧 head 的绿灯和合并了部分 main 都不替代这些验证。本轮保持变更请求,不覆盖已验证的主线补齐实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 选择「补全样式-混合模式」时,按tab键仍未弹出列表,仍然自动补全了当前目录下的路径

2 participants