makecindy / makecindy/cindy

PR #4516 维护者确认:测试里使用 dynamic-eval

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

Description

PR https://github.com/makecindy/cindy/pull/4516 需要维护者确认(security)。

改动摘要:后台子任务冷启动时,在 `maker.createSession` / native bootstrap 之前调用 `reconcileCreateOptsAgainstDb`,把已保存的推理档位(effort)和 Fast 写进首次创建参数。实现只在 `apps/desktop/src/main/maker-ipc/register.ts` 增加一次调用。

为何触发确认门:新增测试 `apps/desktop/src/main/__tests__/backgroundSessionEffort.test.ts` 为避开 Electron / 真实数据库,从 `register.ts` 切片源码、用 TypeScript transpile 后再用 `new Function(...)` 执行。确认门将其记为危险写法 `dynamic-eval`(测试文件第 41 行)。security 类不走 bugfix / 纯技术改动豁免。

请维护者直接在 PR 上 Approve;若认为该测试方式不可接受、需要改成可注入的参数组装或 mock `maker.createSession`,请 Request Changes。

---
关联 PR:#4516(作者 @FicoHub);本 issue 由 review-pr 流程自动创建,用于先讨论该 PR 涉及的安全敏感改动,维护者确认后 PR 会恢复推进。

Contributor guide

Open the contributing guide

Research direction

Review PR #4516 alongside apps/desktop/src/main/maker-ipc/register.ts and apps/desktop/src/main/__tests__/backgroundSessionEffort.test.ts. Start by examining the reconcileCreateOptsAgainstDb call and the test's new Function usage. Done means determining whether the dynamic-eval pattern is acceptable and approving the PR or requesting changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
security, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.