fix(coding): remediate data service review findings

This commit is contained in:
2026-08-27 00:49:59 +08:00
parent 239e20d2cf
commit 38843e091f
15 changed files with 449 additions and 194 deletions

View File

@@ -1347,7 +1347,14 @@ export async function runFinalAsarExtensionProof(): Promise<PiReleaseExtensionPr
throw new Error('Final packaged Pi parent did not load the materialized subagent tool');
}
if (childToolNames.includes('subagent') || childToolNames.some((name) => (
['ask_user', 'agent_browser', 'game_asset_browser', 'game_asset_review', 'task_state', 'changed_file', 'runtime_context']
[
'ask_user', 'agent_browser', 'game_asset_browser', 'game_asset_review',
'task_state', 'changed_file', 'runtime_context',
'data_service_configure', 'data_service_inspect', 'data_service_list_projects',
'data_service_get_document', 'data_service_list_documents', 'data_service_put_document',
'data_service_delete_document', 'data_service_remove_collection', 'data_service_reset',
'data_service_remove_project',
]
.includes(name)
))) {
throw new Error('Final packaged Pi child exposed parent-only product tools');

View File

@@ -4,6 +4,7 @@ import {
type ChildProcessWithoutNullStreams,
} from 'node:child_process';
import { platform } from 'node:os';
import { DATA_SERVICE_PI_TOOL_NAMES } from '../../../shared/data-service';
import { logger } from '../../utils/logger';
import type { CodingRuntimeDisposeReason } from '../contracts';
import { PiProcessError, type PiProcessErrorCode } from './process-errors';
@@ -128,6 +129,7 @@ export function buildPiRpcArgs(
'read', 'bash', 'edit', 'write', 'grep', 'find', 'ls', 'ask_user', 'subagent',
'agent_browser', 'game_asset_browser', 'game_asset_review',
'task_state', 'changed_file', 'runtime_context',
...DATA_SERVICE_PI_TOOL_NAMES,
],
): string[] {
return [