Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(auto): preserve delegated origin at final steer delivery
Dash21b0731d3689
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/pluginTaskAuthorshipWiring.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/pluginTaskAuthorshipWiring.test.tsindex d660e1563c..183e8b2980 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/pluginTaskAuthorshipWiring.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/pluginTaskAuthorshipWiring.test.ts@@ -2,12 +2,35 @@ import { readFileSync } from 'node:fs';import { resolve } from 'node:path';import ts from 'typescript';import { expect, it, vi } from 'vitest';+import { appendAutoReviewUserIntent, AUTO_REVIEW_DELEGATED_CONTINUATION, AUTO_REVIEW_SOURCE_CONTENT, AUTO_REVIEW_USER_INTENT, MAIN_OWNED_SEND_CONTEXT, type SendOptions } from '@cindy/maker-core';const source = readFileSync(resolve(__dirname, '..', 'register.ts'), 'utf8');const compile = (code: string) => ts.transpileModule(code, {compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.None },}).outputText;+it.each(['Do not publish.', '', undefined])('keeps live authority through the final delegated steer boundary: %j', async previous => {+ const start = source.indexOf('await sess.steer(steerPayload as never, {');+ expect(start).toBeGreaterThan(0);+ const end = source.indexOf('\n });', start) + '\n });'.length;+ const deliver = new Function('sess', 'steerPayload', 'so', 'meta', 'restoredSteerIntent',+ 'MAIN_OWNED_SEND_CONTEXT', 'AUTO_REVIEW_SOURCE_CONTENT', 'AUTO_REVIEW_USER_INTENT', 'AUTO_REVIEW_DELEGATED_CONTINUATION',+ compile(`return (async () => { ${source.slice(start, end)} })();`));+ const invoke = async (delegated: boolean) => {+ let result;+ const steer = vi.fn(async (content: string, options: SendOptions) => {+ result = appendAutoReviewUserIntent(previous, content, options);+ });+ await deliver({ steer }, 'Publish now', { [AUTO_REVIEW_SOURCE_CONTENT]: '',+ ...(delegated ? { [AUTO_REVIEW_DELEGATED_CONTINUATION]: true } : {}) }, {}, 'Old persisted permission',+ MAIN_OWNED_SEND_CONTEXT, AUTO_REVIEW_SOURCE_CONTENT, AUTO_REVIEW_USER_INTENT, AUTO_REVIEW_DELEGATED_CONTINUATION);+ expect(steer).toHaveBeenCalledOnce();+ return result;+ };+ expect(await invoke(true)).toEqual(previous ?? 'Old persisted permission');+ expect(await invoke(false)).toEqual('Old persisted permission');+});+it('restores human authorization for both live and cold internal delegated sends', () => {for(const target of ['live','session']) {const start=source.lastIndexOf(`sendUserMessageWithAwaitedGitBaseline(${target}, message, clientId, {`);diff --git a/apps/desktop/src/main/maker-ipc/register.ts b/apps/desktop/src/main/maker-ipc/register.tsindex fd014cfbf1..23bac96ba1 100644--- a/apps/desktop/src/main/maker-ipc/register.ts+++ b/apps/desktop/src/main/maker-ipc/register.ts@@ -13763,6 +13763,7 @@ export function registerMakerIpc(maker: Maker, options: RegisterMakerIpcOptions)signal: so.signal,[MAIN_OWNED_SEND_CONTEXT]: so[MAIN_OWNED_SEND_CONTEXT],[AUTO_REVIEW_SOURCE_CONTENT]: so[AUTO_REVIEW_SOURCE_CONTENT],+ [AUTO_REVIEW_DELEGATED_CONTINUATION]: so[AUTO_REVIEW_DELEGATED_CONTINUATION],[AUTO_REVIEW_USER_INTENT]: restoredSteerIntent,});log.info('steer: delivered', { sessionId, agentKind: sess.agentKind });