makecindy / makecindy/cindy

feat: add Grok Agent Harness for Desktop

Open
#3,027 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

## 使用场景

希望在 Cindy Desktop 中直接使用 Grok Agent,完成代码开发、网页检索、文件处理和自动化任务。

用户应能够像使用 Claude Code、Codex 或 Pi 一样,在 Cindy 中创建 Grok Agent 任务,并使用统一的任务生命周期、工作目录、工具调用、权限确认、停止和恢复体验。

首版需要同时支持:
- xAI 官方 API 账号;
- Grok 订阅账号。

## 当前痛点

目前 Cindy 已经支持部分 Grok/xAI 模型接入、Pi Harness 路由、模型目录和相关协议适配,但 Grok 主要仍作为已有 Harness 中的模型或供应商使用。

这导致:
- Grok 无法作为独立 Agent 在 Agent 选择层使用;
- Grok 原生工具调用、搜索能力、事件流和上下文行为无法完整表达;
- Grok 官方 API 与订阅账号的认证和路由差异缺少统一的 Agent 入口;
- 用户无法明确区分“使用 Grok Agent”和“在其他 Harness 中使用 Grok 模型”;
- Desktop 端无法提供与其他 Agent 一致的任务、权限和错误恢复体验。

## 诉求

新增独立的 Grok Agent Harness,使其作为与 Claude Code、Codex、Pi 并列的 Agent 类型接入 Cindy。

首版优先支持 Desktop,至少覆盖:
- Grok Agent 类型注册、能力描述和模型选择;
- xAI 官方 API 认证、endpoint 和模型路由;
- Grok 订阅账号认证、会话建立和账号状态处理;
- Grok 原生工具调用、搜索工具和流式事件适配;
- Cindy 统一的任务生命周期、会话恢复、停止和重试控制;
- 与现有权限确认和工具审批机制对齐;
- 工作目录、文件操作和 MCP 工具接入;
- 模型切换、上下文压缩、usage/token/cost 统计和错误恢复;
- 凭证缺失、账号不可用、模型不可用或协议不兼容时的明确错误提示;
- Desktop Light/Dark 两种模式下的 Agent 选择和状态展示。

Mobile 和远程场景可以作为后续阶段支持,不应阻塞 Desktop 首版。

## 建议方案

实现上优先复用 Cindy 现有 Agent 抽象、事件协议、权限、会话和模型目录基础设施,不在 Main 或 Renderer 中重新实现一套平行的 Agent Loop。

建议补充以下验收标准:
- Desktop 可以选择 Grok Agent 并创建新任务;
- xAI 官方 API 和 Grok 订阅账号都能完成至少一个包含工具调用的任务;
- 两种账号类型都能正确显示认证状态、模型不可用和请求失败原因;
- Grok 搜索工具和普通 function tools 能按其原生协议工作;
- 用户可以停止、恢复和重新进入 Grok 任务;
- 无凭证或无权限时不会静默回退到其他 Agent、模型或默认网关。

## 已考虑的替代方案

1. 继续通过 Pi Harness 使用 Grok:可以复用现有 Pi 能力,但无法完整表达 Grok 的原生 Agent 行为、认证方式和工具协议。
2. 只增加 Grok 模型目录或 xAI Provider:只能解决模型发现、认证和请求路由,不能解决独立 Agent 的生命周期、权限和事件语义。
3. 通过 Claude Code 或 Codex 兼容层转发 Grok:可以降低接入成本,但存在工具协议、上下文格式、搜索能力和错误恢复方面的兼容性损失。

## 非目标

本 Issue 不负责重做现有 Pi Harness、修改服务端或 Gateway 协议,也不负责首版同时完成 Mobile 和远程端的完整体验。

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by tracing Cindy’s existing Agent abstraction, event protocol, permission flow, session handling, and model directory from the Desktop Agent selection entry point, while keeping Main and Renderer on the shared infrastructure. Done means Desktop can create, run, stop, resume, and restore Grok tasks for both account types with tool calls, clear errors, and Light/Dark status display.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
ai, desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.