Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ff08c18
fix(acp-registry): periodic refreshes no longer revert new models to …
bedair81 Nov 22, 2026
576d5c7
fix(acp-registry): address review findings on catalog reconciliation …
bedair81 Nov 22, 2026
9c0941e
fix(acp-registry): guard accepted catalog against provisional probes …
bedair81 Nov 22, 2026
8b26cee
Merge remote-tracking branch 'origin/main' into fix/acp-registry-peri…
juliusmarminge Nov 22, 2026
65295df
fix(acp-registry): compare provisional probes against retained catalo…
bedair81 Nov 22, 2026
92ac0ed
fix(acp-registry): preserve explicit singleton catalogs, provisional …
bedair81 Nov 22, 2026
dc8adf1
fix(acp-registry): keep provisional model-specific options off retain…
bedair81 Nov 22, 2026
bf576f8
Merge branch 'main' into fix/acp-registry-periodic-model-refresh
bedair81 Nov 22, 2026
7bfb9b0
fix(acp-registry): fix signed-out catalog flips, long-lived session r…
bedair81 Nov 22, 2026
4e55289
fix(acp-registry): track catalog revisions, cache winning reconciliat…
bedair81 Nov 22, 2026
35adc01
Merge remote-tracking branch 'origin/main' into fix/acp-registry-peri…
juliusmarminge Nov 22, 2026
0f30704
fix(acp-registry): harden live options, reasoning disable, and catalo…
bedair81 Nov 22, 2026
b875c2e
fix(acp-registry): simplify catalog key, keep only compatible live ov…
bedair81 Nov 22, 2026
bd05986
fix(acp-registry): reconcile superseded session options and coordinat…
bedair81 Nov 22, 2026
94ab71c
fix(acp-registry): store active catalog separately and rebuild supers…
bedair81 Nov 22, 2026
380b550
fix(acp-registry): harden live replay, overflow selection, and post-p…
bedair81 Nov 22, 2026
690ee94
fix(acp-registry): fix post-probe overflow, multi-model clear retenti…
bedair81 Nov 22, 2026
207074e
Merge branch 'main' into fix/acp-registry-periodic-model-refresh
bedair81 Nov 22, 2026
8eb439d
fix(acp-registry): harden fallback catalog gating, post-probe reasoni…
bedair81 Nov 22, 2026
f5b8c5b
fix(acp-registry): track overflow tails, merge custom overflow models…
bedair81 Nov 22, 2026
792b6b5
fix(acp-registry): preserve overflow tags, catalog reasoning, earlier…
bedair81 Nov 22, 2026
394758e
fix(acp-registry): handle displaced ordinary tails, catalog reasoning…
bedair81 Nov 22, 2026
b9d67a7
fix(acp-registry): scope tail option stripping, isolate overflow-tag …
bedair81 Nov 22, 2026
1991b77
fix(acp-registry): track per-model reasoning, carry replayed reasonin…
bedair81 Nov 22, 2026
6e3614a
fix(acp-registry): unify live reasoning replay, drop superseded pendi…
bedair81 Nov 22, 2026
989dfc7
fix(acp-registry): eagerly strip superseded reasoning, keep __proto__…
bedair81 Nov 22, 2026
c679b08
fix(acp-registry): recover accepted catalog on readiness handoff, res…
bedair81 Nov 22, 2026
eb29a60
fix(acp-registry): track live session reset revision and simplify wat…
bedair81 Nov 22, 2026
aeca1fc
fix(acp-registry): seed reset revision on create and compare clearedT…
bedair81 Nov 22, 2026
5219539
refactor(acp-registry): return cleared watermark atomically from live…
bedair81 Nov 22, 2026
87f75cd
fix(acp-registry): gate signed-out options replay and trace full clears
bedair81 Nov 22, 2026
d5205d3
fix(acp-registry): mark signed out atomically on explicit logout and …
bedair81 Nov 22, 2026
94a65ab
fix(acp-registry): decouple ready-probe auth reopening from live-cata…
bedair81 Nov 22, 2026
2a15283
fix(acp-registry): serialize auth confirmation and replay dropped opt…
bedair81 Nov 22, 2026
1dbbb99
fix(acp-registry): simplify reopened live replay and pin auth/race in…
bedair81 Nov 22, 2026
2e3e302
test(acp-registry): split auth/reopen suite and assert persisted sign…
bedair81 Nov 22, 2026
3ac8263
test(acp-registry): isolate per-test auth cache dir and read persiste…
bedair81 Nov 22, 2026
2ccc5ea
test(acp-registry): create isolated status cache dir before reading p…
bedair81 Nov 22, 2026
042787c
test(acp-registry): decode persisted auth file with Schema instead of…
bedair81 Nov 22, 2026
ae58460
Merge branch 'main' into fix/acp-registry-periodic-model-refresh
bedair81 Nov 23, 2026
c53418e
Merge branch 'main' into fix/acp-registry-periodic-model-refresh
bedair81 Nov 23, 2026
e29ead3
Merge branch 'main' into fix/acp-registry-periodic-model-refresh
bedair81 Nov 24, 2026
b05ae47
Merge remote-tracking branch 'origin/main' into fix/acp-registry-peri…
Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 187 additions & 7 deletions apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5419,7 +5419,9 @@ describe("AcpAdapterV2", () => {
driver: ACP_TEST_DRIVER,
capabilities: AcpProviderCapabilitiesV2,
onSessionConfigurationUpdate: (configOptions) =>
Effect.sync(() => publishedConfigurations.push(configOptions)),
Effect.sync(() => {
publishedConfigurations.push(configOptions);
}),
makeRuntime: makeMockRuntime({
childProcessSpawner,
mockAgentPath,
Expand Down Expand Up @@ -5489,7 +5491,10 @@ describe("AcpAdapterV2", () => {
const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>();
const adoptionHandled = yield* Deferred.make<void>();
const adopted = yield* Deferred.make<void>();
const publishedConfigurations: Array<ReadonlyArray<EffectAcpSchema.SessionConfigOption>> = [];
const publishedConfigurations: Array<{
readonly configOptions: ReadonlyArray<EffectAcpSchema.SessionConfigOption>;
readonly includeCatalog: boolean | undefined;
}> = [];
let publications = 0;
let acpRuntime: AcpSessionRuntime.AcpSessionRuntime["Service"] | undefined;
const instanceId = ProviderInstanceId.make("acp-test-late-session-load-selection");
Expand All @@ -5505,15 +5510,31 @@ describe("AcpAdapterV2", () => {
: Effect.void,
// Holds openSession's own publication until the adapter has seen the
// late response, so adoption overlaps session configuration.
onSessionConfigurationUpdate: (configOptions) =>
(publications++ === 0 ? Deferred.await(adoptionHandled) : Effect.void).pipe(
Effect.andThen(Effect.sync(() => publishedConfigurations.push(configOptions))),
onSessionConfigurationUpdate: (configOptions, _modeState, _modelState, updateOptions) => {
const modelOption = configOptions.find(
(option) => option.category === "model" && option.type === "select",
);
const catalogKey = JSON.stringify(
modelOption?.type === "select" ? modelOption.options : [],
);
const includeCatalog = updateOptions?.lastCatalogKey !== catalogKey;
return (publications++ === 0 ? Deferred.await(adoptionHandled) : Effect.void).pipe(
Effect.andThen(
Effect.sync(() =>
publishedConfigurations.push({
configOptions,
includeCatalog,
}),
),
),
Effect.andThen(
configOptions.some((option) => option.category === "model")
? Deferred.succeed(adopted, undefined)
: Effect.void,
),
),
Effect.as(catalogKey),
);
},
makeRuntime: makeMockRuntime({
childProcessSpawner,
mockAgentPath,
Expand Down Expand Up @@ -5577,12 +5598,171 @@ describe("AcpAdapterV2", () => {
"the selected model was only applied to the provisional setup, which offered no model",
);
assert.isTrue(
publishedConfigurations.at(-1)?.some((option) => option.category === "model"),
publishedConfigurations.at(-1)?.configOptions.some((option) => option.category === "model"),
"the provisional catalog was published over the late session/load one",
);
const modelPublications = publishedConfigurations.filter((entry) =>
entry.configOptions.some((option) => option.category === "model"),
);
assert.isTrue(
modelPublications[0]?.includeCatalog,
"adoption must publish the newly observed session catalog",
);
assert.isFalse(
modelPublications.at(-1)?.includeCatalog,
"subsequent turn reconfiguration with an unchanged catalog must not re-advertise it",
);
}).pipe(Effect.provide(layerTest), Effect.scoped),
);

it.effect(
"deduplicates unchanged config_option_update catalogs and re-advertises on changed choices or active native session replacement",
() =>
Effect.gen(function* () {
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const selfInvocation = yield* resolveSelfInvocation();
const mockAgentPath = yield* bundledMockAgentPath;
type Runtime = AcpSessionRuntime.AcpSessionRuntime["Service"];
let sessionUpdate: Parameters<Runtime["handleSessionUpdate"]>[0] | undefined;
const makeModelSelect = (
currentValue: string,
choices: ReadonlyArray<{ readonly value: string; readonly name: string }>,
): ReadonlyArray<EffectAcpSchema.SessionConfigOption> => [
{
id: "model",
name: "Model",
category: "model",
type: "select",
currentValue,
options: [...choices],
},
];
const initialChoices = [
{ value: "default", name: "Default" },
{ value: "composer-2", name: "Composer 2" },
] as const;
let activeConfigOptions: ReadonlyArray<EffectAcpSchema.SessionConfigOption> =
makeModelSelect("default", initialChoices);
const publications: Array<{ readonly includeCatalog: boolean | undefined }> = [];
const instanceId = ProviderInstanceId.make("acp-test-catalog-dedupe");
const adapter = yield* makeAcpAdapterV2({
instanceId,
flavor: {
driver: ACP_TEST_DRIVER,
capabilities: AcpProviderCapabilitiesV2,
onSessionConfigurationUpdate: (
configOptions,
_modeState,
_modelState,
updateOptions,
) => {
const modelOption = configOptions.find(
(option) => option.category === "model" && option.type === "select",
);
const catalogKey = JSON.stringify(
modelOption?.type === "select" ? modelOption.options : [],
);
const includeCatalog = updateOptions?.lastCatalogKey !== catalogKey;
return Effect.sync(() => {
publications.push({ includeCatalog });
return catalogKey;
});
},
makeRuntime: makeMockRuntime({
childProcessSpawner,
mockAgentPath,
wrapRuntime: (runtime) => ({
...runtime,
getConfigOptions: Effect.sync(() => activeConfigOptions),
handleSessionUpdate: (next) =>
Effect.sync(() => {
sessionUpdate = next;
}).pipe(Effect.andThen(runtime.handleSessionUpdate(next))),
}),
}),
},
selfInvocation,
});
const threadId = ThreadId.make("thread-acp-catalog-dedupe");
const runtimePolicy = ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({
runtimeMode: "full-access",
interactionMode: "default",
cwd: process.cwd(),
});
const modelSelection = { instanceId, model: "default" } as const;
const sessionRuntime = yield* adapter.openSession({
threadId,
providerSessionId: ProviderSessionId.make("provider-session-acp-dedupe"),
modelSelection,
runtimePolicy,
});
const providerThread = yield* sessionRuntime.ensureThread({
threadId,
modelSelection,
runtimePolicy,
});
const initialNativeId = providerThread.nativeThreadRef?.nativeId;
if (typeof initialNativeId !== "string") {
assert.fail("expected initial native thread id");
}
assert.deepEqual(
publications.map((entry) => entry.includeCatalog),
[true],
"initial session setup publishes its catalog",
);

// config_option_update with unchanged model choices sets includeCatalog: false.
activeConfigOptions = makeModelSelect("composer-2", initialChoices);
yield* sessionUpdate!({
sessionId: initialNativeId,
update: { sessionUpdate: "config_option_update", configOptions: [] },
});
assert.deepEqual(
publications.map((entry) => entry.includeCatalog),
[true, false],
);

// config_option_update with changed model choices sets includeCatalog: true.
activeConfigOptions = makeModelSelect("composer-2", [
...initialChoices,
{ value: "composer-3", name: "Composer 3" },
]);
yield* sessionUpdate!({
sessionId: initialNativeId,
update: { sessionUpdate: "config_option_update", configOptions: [] },
});
assert.deepEqual(
publications.map((entry) => entry.includeCatalog),
[true, false, true],
);

// Replacing the active native session inside the same openSession (rollbackThread)
// resets lastPublishedCatalogKey so the first publication with identical choices
// sets includeCatalog: true again.
const rolledBack = yield* sessionRuntime.rollbackThread({
providerThread,
providerThreadTurns: [],
target: {
type: "thread_start",
checkpointId: CheckpointId.make("checkpoint-acp-catalog-dedupe"),
appRunOrdinal: 0,
},
});
const rolledBackNativeId = rolledBack.providerThread.nativeThreadRef?.nativeId;
if (typeof rolledBackNativeId !== "string") {
assert.fail("expected rolled-back native thread id");
}
yield* sessionUpdate!({
sessionId: rolledBackNativeId,
update: { sessionUpdate: "config_option_update", configOptions: [] },
});
assert.deepEqual(
publications.map((entry) => entry.includeCatalog),
[true, false, true, true],
);
}).pipe(Effect.provide(layerTest), Effect.scoped),
);

// Adoption either reaches the adapter after openSession configured the
// provisional setup, or before it, so openSession configures the adopted one.
it.live.each([false, true])(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1009,16 +1009,16 @@ describe("AcpRegistryAdapterV2", () => {
})),
[
{ models: ["hermes", "auto", "default"], current: "default" },
{ models: ["hermes", "auto", "default"], current: "hermes" },
{ models: ["hermes", "auto", "default"], current: null },
{ models: ["hermes", "auto", "default"], current: "auto" },
{ models: ["hermes", "auto", "default"], current: "default" },
{ models: ["auto"], current: null },
{ models: [], current: "hermes" },
{ models: [], current: null },
{ models: [], current: "auto" },
{ models: [], current: "default" },
{ models: ["auto"], current: null },
{ models: [], current: null },
{ models: ["default"], current: null },
{ models: ["default"], current: null },
{ models: ["hermes", "auto", "default"], current: "default" },
{ models: ["hermes", "auto", "default"], current: "hermes" },
{ models: [], current: null },
{ models: [], current: "default" },
{ models: [], current: "hermes" },
],
);
}).pipe(Effect.provide(layerTest)),
Expand Down
Loading
Loading