fix(dsbench): adapt evaluation config to master runtime

This commit is contained in:
Yichen Jiang
2026-07-19 14:53:39 +08:00
parent 3df3c6bf37
commit 3956118c18
6 changed files with 17 additions and 6 deletions

View File

@@ -45,6 +45,8 @@ export const Config: Schema<JsonRpcConfig> = Schema.object({
* owns root-context disposal for EOF and signals.
*/
export function apply(ctx: Context, config: JsonRpcConfig): void {
// Cordis applies the schema default before invoking the plugin.
const resolvedConfig = config as JsonRpcConfig & { maxTokensAsSuccess: boolean }
// The later transport callback must dispose this plugin's fiber, not its ambient context.
const fiber = ctx.fiber
/* v8 ignore next -- production stdio wiring; tests always inject the runtime seams */
@@ -56,7 +58,7 @@ export function apply(ctx: Context, config: JsonRpcConfig): void {
const transport = new JsonRpcLineTransport(input, output)
const server = new HarnessSdkServer(ctx, transport, {
maxTokensAsSuccess: config.maxTokensAsSuccess ?? false,
maxTokensAsSuccess: resolvedConfig.maxTokensAsSuccess,
})
// Share one exit task and attempt flush and disposal independently before exiting.