Skip to content

feat(gupi): add temporary sessions and global shortcut actions - #233

Merged
suxiaoshao merged 8 commits into
codex/217-gupi-pi-rpc-clientfrom
codex/221-gupi-global-shortcuts
Sep 19, 2026
Merged

suxiaoshao merged 8 commits into
codex/217-gupi-pi-rpc-clientfrom
codex/221-gupi-global-shortcuts

Conversation

@suxiaoshao

@suxiaoshao suxiaoshao commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

为 Gupi 增加独立于主窗口任务的临时多会话窗口、全局模板快捷任务和托盘入口。临时窗口隐藏或回收后,已有会话和 Pi 任务继续由应用持有;可从操作面板复制或回填最后完整回答。

目标分支为父 Issue #217codex/217-gupi-pi-rpc-client。相对该分支,本 PR 仅增加 #221 的一个实现提交。相对仓库 main,父分支已经包含 Gupi 启动引导、Pi RPC 生命周期、会话工作区与历史、命令入口、运行展示和统一设置;这些前序内容由父分支承接,本 PR 在此基础上补齐临时窗口阶段。

Motivation

用户需要在主窗口任务运行期间,通过系统快捷键对选中文字或剪贴板内容执行已有 Pi 模板,并能恢复、切换和清理临时会话。后台运行也需要托盘提供主窗口、设置和退出入口。

Changes

  • 主窗口与临时会话从已保存配置直接创建,不再等待应用级 Pi 版本检测;命令查找、进程启动与 RPC 就绪由会话连接流程负责。版本检查仅在设置中用于诊断与版本展示,模板任务沿用现有会话准备流程。
  • 增加临时多会话与独立工作目录,以 --no-session 启动 Pi;临时内容和草稿不进入普通会话目录。窗口失焦隐藏,隐藏 600 秒后仅回收视图,重新召唤恢复应用持有的会话。
  • 在现有快捷键设置中接入全局召唤键、模板快捷任务及本次模型/思考等级覆盖,统一处理冲突、保存失败回滚、重复触发与退出收尾。
  • 增加右下角 Cmd/Ctrl+K 操作面板、会话数字导航和新建时复用未发送页面。运行时显示停止、空闲时显示隐藏;移到废纸篓默认 Cmd/Ctrl+Shift+Backspace,各操作键位可配置。
  • 输入为空且没有附件时,Enter 回填最后完整回答;有输入时继续发送。回填校验目标应用、焦点、剪贴板和调用有效性,失败保留剪贴板并提示。
  • 普通与临时输入共用文件/图片附件流程;补充平台焦点恢复与粘贴支持、托盘入口,以及忙碌保护下的临时会话和目录清理。
  • 更新阶段计划和总待处理文档,在 Gupi README 顶部补充入口;保留输入框组件升级的依赖与范围。

Validation

  • 受影响的 Gupi 构建与 macOS 标准 bundle。
  • Gupi 回归及失败项修正后的定向复测。
  • platform-ext 测试和受影响 crate 的 Clippy。
  • workspace 格式检查、diff 检查及相关文档本地链接检查。
  • macOS 隔离配置和离线 Pi fixture 下的重点原生交互。
  • 完整 workspace 多平台 CI 和全部原生验收。

实际执行及结果:

cargo check -p gupi --offline
cargo run -p xtask --offline -- bundle gupi
  通过;actool 的 Liquid Glass 图标导出失败,打包器按既有逻辑保留普通图标并完成签名。

cargo test -p gupi -p platform-ext --locked --offline
  Gupi 完整运行 181/183 通过;两项旧快捷键测试依赖命令列表序号。
  改为按动作 ID 定位后执行以下定向复测,覆盖全部三项快捷键设置测试:
cargo test -p gupi --locked --offline features::settings::keys::tests
  3/3 通过。
cargo test -p platform-ext --locked --offline
  1/1 通过,文档测试通过。

cargo clippy -p gupi -p platform-ext --all-targets --locked --offline -- -D warnings
cargo fmt --all -- --check
git diff --check
  通过。

重点验证覆盖会话隔离、窗口重建保留草稿、操作面板、新建复用、数字导航、最终回答提取、空白/非空输入分发、停止/隐藏切换,以及设置页改绑保存和菜单键帽同步。原生验证使用隔离目录;测试实例与临时数据已清理。

补充验证:主窗口/临时状态不依赖版本探测、模板任务触发与去重回归通过;RPC 进程测试 10 项、临时窗口相关回归和 Gupi/pi-rpc Clippy 通过,pi-rpc 已交叉编译检查 Windows 目标。macOS 隔离原生验证确认:启动不调用 --version,设置诊断失败后主会话和新临时会话仍可用。系统热键合成未触发,不视作真实模板快捷键验收。

Risks

  • 输入框后续改造暂缓,等待 InputGroup #3042原子内联标签 #3113 均进入兼容的 gpui-kit 正式版本后,再升级接入。Skill 填入正文、标签交互和相关模板/文件行为保留在接入计划中,本 PR 不提前切换 Git 依赖或自建编辑器。
  • 真实系统热键、外部应用取词及自动粘贴成功路径、权限允许/拒绝、托盘点击、原生附件入口和跨屏行为尚未完整实机验证;Windows 尚无实机结果。Linux/Wayland 系统热键不在本阶段支持范围。
  • 当前 CI 仅匹配目标为 main 的 PR,因此向父 Issue 分支提交不会自动触发该工作流。本 PR 未修改 CI 触发范围,也不将本机验证视作多平台 CI 通过。

详细记录:阶段计划总待处理文档

Related Issues

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-19T09:46:25.209091Z be4e7dc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e735fbd3d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/gupi/src/state/conversation/temporary.rs Outdated
Comment thread app/gupi/src/app/temporary.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 730060f72c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/gupi/src/app/temporary.rs Outdated
Comment thread app/gupi/src/app/shortcuts.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

monitors
.iter()
.position(|candidate: &HMONITOR| candidate.0 == monitor.0)
.map(|index| index as u32)

P2 Badge Return the HMONITOR-backed display ID on Windows

On Windows with multiple monitors, this returns the monitor's enumeration ordinal, but target_display_id compares it with GPUI DisplayId values, which the pinned Windows backend derives from the raw HMONITOR. The direct lookup therefore never selects the cursor's monitor; the remaining fallback compares GetCursorPos device coordinates with DPI-scaled GPUI bounds, so mixed-DPI layouts can open the temporary window on the wrong display.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/gupi/src/state/config.rs
Comment thread app/gupi/src/state/shortcuts.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de88d79772

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/gupi/src/state/shortcuts.rs Outdated
Comment thread app/gupi/src/app/temporary.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f764868e94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/gupi/src/app/shortcuts.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86eb3bc465

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/gupi/src/state/conversation.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7823d3b944

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/gupi/src/state/config.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be4e7dc67f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/gupi/src/app/shortcuts.rs
Comment thread app/gupi/src/state/keybindings.rs
@suxiaoshao
suxiaoshao merged commit d7c1608 into codex/217-gupi-pi-rpc-client Sep 19, 2026
@suxiaoshao
suxiaoshao deleted the codex/221-gupi-global-shortcuts branch September 19, 2026 10:05
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.

1 participant