You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/SECTL/SecAgent/'
Activity
PANDAJSR commentedon Aug 31, 2026
/oc 给出计划方案
github-actions commentedon Aug 31, 2026
已完成调研。以下是针对 issue「计划增加操作 SecScore 的自动化测试」的方案。
计划方案:SecScore 操作自动化测试
一、背景与结论先行
SECTL/SecScore-SecAgent-Connector(插件 idsecscore-connector,当前 v2.1.6)。其 README 明确「不连接本机 SecScore,也不创建本地数据库」,直接请求SECSCORE_SYNC_SERVER_URL(默认https://secscore-api.sectl.cn)的/v1/classes、/v1/snapshot、/v1/sync、/v1/operations等接口——这就是「去掉 secscore 后端」的含义:测试必须把后端 mock 掉,不能依赖真实云端/本机 SecScore。main.mjs):add_score(对模型可见)list_students、find_students、list_groups、list_group_members(隐藏,必须经secagent__call_hidden_tool调用)skills/secscore,带自动加载正则(匹配"加分/扣分/积分"等关键词)。runtime.test.ts和model-provider.test.ts都是注入 fakeauthBridge+ mockglobalThis.fetch脚本化 SSE 响应。二、Mock 设计(两层)
config.agent.baseUrl指向不可达/本地地址,mockglobalThis.fetch对模型端点的 SSE 响应,返回「工具调用 → 最终回答」的脚本序列(与现有测试完全一致)。SECSCORE_SYNC_SERVER_URL指向本地 fake Sync Server(http://127.0.0.1:<port>,node:http实现),维护内存学生/积分表,实现四个端点:GET /v1/classes(插件激活时自动选班级)GET /v1/snapshot?class_id=...与POST /v1/sync(查询学生与分组)POST /v1/operations(加分/扣分,写入内存表)SECTL_OFFICIAL_API_URL,跳过 Relay introspection/oauth 转换;PluginManager注入 fakeauthBridge,getSession()返回{ accessToken: "test-token", userId: "u1", ... }。/chat/completions走模型脚本,其余请求转发给本地 fake server。三、测试文件与结构(均在 SecAgent 仓库)
新增
src/secscore-connector.test.ts(沿用node:test+assert,随npm test运行,CIbuild.yml已有build:cli + npm test步骤),配套src/test-fixtures/secscore-connector/目录存放插件源码副本。插件包获取:不用网络下载 release,而是把
main.mjs、secagent-plugin.json、skills/secscore/SKILL.md拷入 fixtures,测试内用 AdmZip 动态打包→PluginManager.install()。好处是锁定插件契约(工具 key、参数名、Skill 自动加载正则),插件侧一旦改动契约,测试立即失败。可复用 helper:
fakeSecScoreServer(seedStudents)→ 返回{ port, close(), getState() },内置一/二组、6~8 名学生(含小明/小张/小泽)及积分;modelScript(...)→ 把 tool_calls→answer 序列转成 SSE 响应;runWithPlugin(prompt, script)→ temp workspace → 装插件 →SecAgentRuntime.run()→ 收集 trace 与审计记录。四、用例(四个提示词)与断言
小明有几分find_students/list_students查小明 → 回答secagent.skills/auto-load);调用的是插件工具 key(secscore-connector__*)给小明小张和小泽加两份,昨天主动帮忙值日了add_score(delta=2,reason=「昨天主动帮忙值日了」)score_delta=2、reason_content正确;回答确认三人 +2 并报变更前后分数;再次查询三人各 +2给一组所有人加一分list_group_members(group_name="一组")→ 对每个组员add_score(1)总积分超过50的有哪些人list_students→ 过滤 score>50 → 回答每个用例额外断言:写入工具的审计记录存在(
audit.log中 tool=secscore-connector__add_score)、无未注册工具错误。五、需要改动的文件清单
SecAgent仓库:src/secscore-connector.test.ts(主测试)runtime.ts/plugin-manager.ts/mcp-adapter.ts均保持不动SECTL/SecScore-SecAgent-Connector仓库(可选,若 issue 希望插件侧也加):main.test.mjs,直接 mockapi对象(api.fetch/api.getSectlSession/api.setConfig),单元测试addScore的同名校验、listStudents过滤、findStudent精确/模糊匹配等纯逻辑;package.json增加node --test脚本。六、风险与注意
add_score对模型可见,其余隐藏:用例应验证隐藏工具只能经secagent__call_hidden_tool调用(Skill 正文即契约)。SecScoreMcpAdapter/doctor仍引用localhost:3901的旧 MCP 配置,与插件流程无关,本次不改、不受影响。refreshConnection激活即请求/v1/classes,fake server 必须最先实现该端点,否则插件状态为 error。七、实施步骤
npm run build:cli && npm test全量跑通(CI 已覆盖);api的单元测试并接入其 CI。需要我直接按此方案开始实现吗?
opencode session | github run
PANDAJSR commentedon Aug 31, 2026
/oc 好的实现
github-actions commentedon Aug 31, 2026
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: empty ident name (for runner@runnervmgx7h7.2teta1ngcx3e5onlpkheve315a.bx.internal.cloudapp.net) not allowed
opencode session | github run
PANDAJSR commentedon Aug 31, 2026
/oc 请继续完成,提交代码并创建 PR
github-actions commentedon Aug 31, 2026
GitHub Actions is not permitted to create or approve pull requests. - https://docs.github.com/rest/pulls/pulls#create-a-pull-request
opencode session | github run
PANDAJSR commentedon Sep 1, 2026
/oc 重试
PANDAJSR commentedon Sep 1, 2026
/oc 重试
opencode-agent commentedon Sep 1, 2026
Created PR #17
opencode session | github run
opencode-agent commentedon Sep 1, 2026
User opencode-agent[bot] does not have write permissions
github run
PANDAJSR commentedon Sep 4, 2026
/oc 重试:请继续完成之前的任务;如果任务目标是其他仓库,请使用 GH_TOKEN 访问对应仓库并直接提交代码、创建 PR。
github-actions commentedon Sep 4, 2026
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/SECTL/SecAgent/'
opencode session | github run
PANDAJSR commentedon Sep 5, 2026
/oc 继续执行之前的任务:请从当前状态继续完成代码修改,配置 Git 身份和认证已修复;完成测试后直接提交新分支并创建 PR。若任务目标是其他 SECTL 仓库,请使用 GH_TOKEN 访问目标仓库并在那里创建 PR。
PANDAJSR commentedon Sep 5, 2026
/oc 继续重试:请从之前中断的位置继续完成任务,使用已修复的跨仓库 Git 认证,完成代码修改和测试后直接提交新分支并创建 PR;如果目标是中转服务,请访问 SECTL/secagent-official-relay 并在那里创建 PR。
PANDAJSR commentedon Sep 5, 2026
/oc 继续执行:请从之前中断处恢复,先确认目标仓库和当前状态;完成代码修改、测试、提交和 PR。不要只输出方案。
github-actions commentedon Sep 5, 2026
fatal: unable to access 'https://github.com/SECTL/SecAgent/': The requested URL returned error: 400
opencode session | github run