Repository navigation
Conversation
added 2 commits
November 14, 2026 15:29
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 Antigravity 桌面客户端接入补齐原生
/指令发现与结构化发送、Skill 多选、/compact上下文压缩以及基于共享WorkModes的plan/goal工作模式(基于v2.2.11004e5ae)。主要改动
1. 后端原生能力发现与结构化发送
cli_session.py_ALLOWED_METHODS新增只读白名单 RPCGetSlashCommands。slash_commands()与_raw_model_for_commands(),按当前会话所选模型 /defaultOverrideModelConfig/ 首个已启用模型动态解析MODEL_*并携带cascadeId、workspaceUris实时拉取原生指令,按info.type归一化为system/skill/workflow。adapter.pylive=True)时开放skills、multiSkills、slashCommands、compact、plan、goal能力。catalog新增section='commands'支持,并在全量目录中返回commands与skills(拉取失败时优雅降级返回空列表与pluginError)。_build_message_items()将消息开头的已知/指令及多选plugins(最多 8 个、去重)构造为原生{'item': {'slashCommand': {'info': ...}}}结构化项发送;未知前缀及/usr/bin等普通路径保持纯文本发送。compact、goal(operation='set')与work-mode(default/plan)动作,执行前校验连接状态、待确认审批与原生空闲状态。queue/steer时,_reject_busy_structured_follow_up()显式拒绝夹带/指令、plugins或plan/goal模式的后续消息,防止结构化字段静默丢失。2. 共享前端、Relay 路由与国际化
composer-commands.js&desktop-sessions.jsComposerCommands支持action.native:菜单展示Skill ·/工作流 ·前缀,选中后插入/<id>,提交时直接透传后端。DesktopSessionsView按作用域缓存并刷新原生/指令(含plan/goal/compact兜底),并在capabilities.multiSkills === true时允许 Skill 多选(保留 Claude CLI 单选逻辑不变)。relay/protocol.py&web/shared/i18n.jsPOST /api/desktop-sessions/antigravity/compact与goal。/<command>错误模式匹配)。2026-11-14-antigravity-native-slash-commands.md。验证结果(基于提交
0b29440c)已执行且通过
python3 -B scripts/check-boundaries.py:Module boundaries passed; 22 explicit legacy edges remain.PYTHONPATH=.:tests python3 -B -m unittest tests.test_antigravity_adapter tests.test_antigravity_discovery tests.test_shared_relay tests.test_desktop_sessions tests.test_modes tests.test_native_compaction tests.test_claude_native_commands tests.test_relay_admin):Ran 207 tests — OKTZ=UTC node --test tests/composer-commands.test.cjs tests/desktop-sessions-ui.test.cjs tests/operation-i18n.test.cjs tests/localization.test.cjs tests/gateway-language.test.cjs tests/relay-routing.test.cjs):231/231 pass (0 fail)node_modules的desktop.test.cjs与packaged-qr.test.cjs):1533 pass, 0 fail, 1 skippedHTTP 200,调用Antigravity.call('catalog', sid, {'section': 'commands'})实际返回 16 条指令(含 7 个 Skills、teamwork/boost/plan/goal/compact等),pluginError=None。全量后端测试(含 1 项与本 PR 无关的既有失败)
python3 -B scripts/test-backend.py --source-only:Ran 4085 tests(failures=1, skipped=59;跳过项为--source-only与 Windows 平台检查)test_pty_terminal.PtyTests.test_close_kills_foreground_process(Linux PTY 进程清理时序,与本 PR 无关)。未在本机执行(待 CI 或真实桌面联调覆盖)
tests/desktop.test.cjs、tests/packaged-qr.test.cjs与npm run test:browser(Playwright):本机环境未安装node_modules(Electron / jsQR / Playwright)。/compact、/goal或/teamwork写入请求(结构化items编码基于适配器单测校验)。