Skip to content

feat(acp): add consented Windows terminal authentication - #190

Draft
YoungSx wants to merge 23 commits into
mainfrom
feat/acp-terminal-authentication
Draft

feat(acp): add consented Windows terminal authentication#190
YoungSx wants to merge 23 commits into
mainfrom
feat/acp-terminal-authentication

Conversation

@YoungSx

@YoungSx YoungSx commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Agent 提供 terminal 鉴权方式时,SalmonEgg 先征得用户同意,再按当前 stdio 连接实际启动的命令、参数、环境与工作目录打开独立 PTY,并追加该鉴权方式要求的参数和环境覆盖。登录进程退出 0 且完成回收后,由现有连接协调器强制重连,并在新连接上重试原操作。取消、关闭登录对话框或退出应用会回收登录进程树;terminal 方法不会作为 authenticate 请求发送。

登录身份包含会话、profile、服务实例与连接 ID,意图切换后旧登录结果不能恢复旧连接。普通会话和新会话入口复用同一重试链。终端展示使用原生 ContentDialog,ViewModel 驱动状态,启动快照和 PTY 输出不写入日志。

权限提示和回复现在绑定原始请求实例:切换会话、连接更换或请求 ID 复用后,旧按钮和迟到结果不能回答或关闭新提示;发送失败时保留仍有效的请求供重试。SDK 提供回复是否成功的结果,兼容已有公开回调。session/cancel 的发送、待处理请求清理和会话状态更新使用同一连接身份,排队中的旧取消不能进入替换后的连接。

当前仅交互式 Windows 桌面宿主声明 auth.terminal;其他平台保持能力门控。Windows 专属测试工程与 hosted workflow 对真实 ConPTY 启动和进程回收设置门禁,4 个用例必须实际执行且零跳过。

本轮本地验证对应提交 6748054799e4d0fbe98566f893402ff2a2a18c18

  • 完整 SDK gate:restore、format、analyzer build、819/819 测试及打包通过,零跳过;SDK 与 SDK 测试构建均为零警告、零错误。包针对正式基线 1.0.0 完成兼容验证。
  • 本次 SalmonEgg.Acp.1.0.1-alpha.0.188.nupkg 的外部消费通过:独立 NuGet cache/source mapping、稳定版默认 v1 initialize、旧传输源码兼容、1.0.0 传输程序集在新包上的二进制兼容、38 个草案类型逐个触发 SEACP002,以及 NoWarn 和 pragma 两种文档化抑制方式。包内唯一 lib 目标为 net10.0,仓库提交元数据与上述 SHA 一致。
  • Presentation 定向测试:鉴权协调与重试 46/46,权限请求所有权 13/13,新会话终端鉴权 3/3,new-session null 回归 1/1,均零跳过。Presentation 测试编译仍有既有 CS8604 和 xUnit1051 警告,本轮未宣称该工程零警告。
  • SDK tag/version 门禁的 11 个正反例通过;提交差异检查通过。

当前提交的产品平台构建、GUI CI 与真实 Windows ConPTY 门禁等待推送后验证,保持 draft。旧 SHA 的 ConPTY 结果只作为历史记录,不计入本轮验收。Windows 登录对话框的真机 GUI 和真实第三方 Agent 仍待验收,本 PR 不关闭总单。

Refs #144, #147.

Default only an absent v1 type to agent, reject non-string discriminators, and preserve unsupported strings and payload fields. Share version-aware authentication serialization across DTO, collection, and initialize roots so unknown fields cannot override the negotiated method identity.

Add raw initialize transport regressions, presentation selection coverage, and schema round-trip properties. Validation: 593 SDK tests, 26 presentation authentication tests, analyzer and package validation, external nupkg consumer, and a 9-case failing whitelist mutation.

Refs #147
Apply negotiated identifiers and required message identities across direct, collection, and parent contracts. Preserve unknown command and resource metadata, honor explicit schema recovery rules, and keep v1-only state off draft wire.

Keep live v2 disabled and preserve the published serialization surface. Validate 680 SDK tests, package compatibility against 1.0.0, and 38 draft consumer diagnostics; version-rule mutations fail 45 targeted cases.
Use the running agent invocation for independent ConPTY sign-in, reconnect through the authoritative connection owner and retry with the fresh service. Gate capability advertisement on a Windows process host and interactive surface; Porta.Pty 1.0.7 cannot distinguish Unix signal termination from a normal zero exit. Remove that restriction only after upstream exposes a trustworthy exit result and the native gate covers it.
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
salmonegg Ready Ready Preview Sep 9, 2026 3:51pm UTC

Wait for the native canvas and splash removal within the existing boot deadline before enabling accessibility once. Uno 6.7.103 (cd452e3ee242c9a2a8dee5e65ad8088b6f5dbf83) can retain initial sibling bounds when ancestor layout moves after early semantic activation, causing pointer gates to click an adjacent card.

Validated against the same Debug product with CPU throttle 4: early activation fails, late activation passes, restoring early fails, restoring late passes. The unchanged two-round pointer gate passes with the final helper at CPU rates 4 and 1. Product focus code is unchanged.
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