GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(acp-registry): periodic refreshes no longer revert new models to stale session state by bedair81 · Pull Request #40714 · pingdotgg/t3code

fix(acp-registry): periodic refreshes no longer revert new models to stale session state #40714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bedair81 wants to merge 43 commits into pingdotgg:main from bedair81:fix/acp-registry-periodic-model-refresh
+11,384 −877
Closed

fix(acp-registry): periodic refreshes no longer revert new models to stale session state #40714

Show file tree
Hide file tree
Changes from 3 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

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

50 changes: 50 additions & 0 deletions 50 packages/provider-acp-registry/src/server/AcpRegistryRuntimeCoordinator.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,54 @@ describe("AcpRegistryRuntimeCoordinator", () => {
yield* Fiber.interrupt(consumer);
}).pipe(Effect.provide(AcpRegistryRuntimeCoordinator.layer)),
);

it.effect(
"tracks live configuration revisions so stale snapshots are neither replayed nor able to clear newer ones",
() =>
Effect.gen(function* () {
const coordinator = yield* AcpRegistryRuntimeCoordinator.AcpRegistryRuntimeCoordinator;
const instanceId = ProviderInstanceId.make("acpRegistry_devin");
const configFor = (id: string) => ({
models: [{ id, name: id, description: null }],
currentModelId: id,
configOptions: [],
modelsFromModelSelect: true,
});

yield* coordinator.publishLiveConfiguration(instanceId, configFor("model-v1"));
const first = yield* coordinator.getLiveConfigurationWithRevision(instanceId);
expect(first.revision).toBeGreaterThan(0);

// Watching past the already-observed revision skips the stale replay, then delivers newer updates.
const received: Array<string | null> = [];
const secondSeen = yield* Deferred.make<void>();
const watcher = yield* coordinator
.watchLiveConfiguration(
instanceId,
(configuration) =>
Effect.sync(() => {
received.push(configuration.currentModelId);
}).pipe(Effect.andThen(Deferred.succeed(secondSeen, undefined)), Effect.asVoid),
{ afterRevision: first.revision },
)
.pipe(Effect.forkChild({ startImmediately: true }));

yield* coordinator.publishLiveConfiguration(instanceId, configFor("model-v2"));
yield* Deferred.await(secondSeen);
yield* Fiber.interrupt(watcher);
expect(received).toEqual(["model-v2"]);

// An outdated revision cannot clear a newer live configuration.
expect(
yield* coordinator.clearLiveConfigurationIfRevision(instanceId, first.revision),
).toBe(false);
expect(Option.isSome(yield* coordinator.getLiveConfiguration(instanceId))).toBe(true);

const second = yield* coordinator.getLiveConfigurationWithRevision(instanceId);
expect(
yield* coordinator.clearLiveConfigurationIfRevision(instanceId, second.revision),
).toBe(true);
expect(Option.isNone(yield* coordinator.getLiveConfiguration(instanceId))).toBe(true);
}).pipe(Effect.provide(AcpRegistryRuntimeCoordinator.layer)),
);
});
102 changes: 85 additions & 17 deletions 102 packages/provider-acp-registry/src/server/AcpRegistryRuntimeCoordinator.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ interface AvailableCommandsUpdate {
interface LiveConfigurationUpdate {
readonly instanceId: ProviderInstanceId;
readonly configuration: AcpRegistryLiveConfiguration;
readonly revision: number;
}

interface LiveConfigurationEntry {
readonly configuration: AcpRegistryLiveConfiguration;
readonly revision: number;
}

interface LiveConfigurationState {
readonly nextRevision: number;
readonly entries: ReadonlyMap<ProviderInstanceId, LiveConfigurationEntry>;
}

export interface AcpRegistryLiveConfigurationSnapshot {
readonly configuration: Option.Option<AcpRegistryLiveConfiguration>;
readonly revision: number;
}

interface UrlAuthActionUpdate {
Expand Down Expand Up @@ -67,16 +83,24 @@ export class AcpRegistryRuntimeCoordinator extends Context.Service<
onUpdate: (commands: AcpRegistryAvailableCommands) => Effect.Effect<void>,
) => Effect.Effect<void>;
readonly clearLiveConfiguration: (instanceId: ProviderInstanceId) => Effect.Effect<void>;
readonly clearLiveConfigurationIfRevision: (
instanceId: ProviderInstanceId,
revision: number,
) => Effect.Effect<boolean>;
readonly publishLiveConfiguration: (
instanceId: ProviderInstanceId,
configuration: AcpRegistryLiveConfiguration,
) => Effect.Effect<void>;
readonly getLiveConfiguration: (
instanceId: ProviderInstanceId,
) => Effect.Effect<Option.Option<AcpRegistryLiveConfiguration>>;
readonly getLiveConfigurationWithRevision: (
instanceId: ProviderInstanceId,
) => Effect.Effect<AcpRegistryLiveConfigurationSnapshot>;
readonly watchLiveConfiguration: (
instanceId: ProviderInstanceId,
onUpdate: (configuration: AcpRegistryLiveConfiguration) => Effect.Effect<void>,
options?: { readonly afterRevision?: number },
) => Effect.Effect<void>;
readonly requestUrlAuthentication: (
instanceId: ProviderInstanceId,
Expand All @@ -103,9 +127,10 @@ const make = Effect.gen(function* () {
new Map<ProviderInstanceId, AcpRegistryAvailableCommands>(),
);
const liveConfigurationUpdates = yield* PubSub.unbounded<LiveConfigurationUpdate>();
const liveConfigurationByInstance = yield* Ref.make(
new Map<ProviderInstanceId, AcpRegistryLiveConfiguration>(),
);
const liveConfigurations = yield* Ref.make<LiveConfigurationState>({
nextRevision: 0,
entries: new Map(),
});
const urlAuthActionUpdates = yield* PubSub.unbounded<UrlAuthActionUpdate>();
const pendingUrlAuthActions = yield* Ref.make(
new Map<ProviderInstanceId, PendingUrlAuthAction>(),
Expand Down Expand Up @@ -206,43 +231,84 @@ const make = Effect.gen(function* () {

const clearLiveConfiguration: AcpRegistryRuntimeCoordinator["Service"]["clearLiveConfiguration"] =
(instanceId) =>
Ref.update(liveConfigurationByInstance, (current) => {
const next = new Map(current);
next.delete(instanceId);
return next;
Ref.update(liveConfigurations, (state) => {
if (!state.entries.has(instanceId)) return state;
const entries = new Map(state.entries);
entries.delete(instanceId);
return { ...state, entries };
});

const clearLiveConfigurationIfRevision: AcpRegistryRuntimeCoordinator["Service"]["clearLiveConfigurationIfRevision"] =
Effect.fn("AcpRegistryRuntimeCoordinator.clearLiveConfigurationIfRevision")(
function* (instanceId, revision) {
return yield* Ref.modify(liveConfigurations, (state) => {
const current = state.entries.get(instanceId);
if (current === undefined) return [true, state] as const;
if (current.revision !== revision) return [false, state] as const;
const entries = new Map(state.entries);
entries.delete(instanceId);
return [true, { ...state, entries }] as const;
});
},
);

const publishLiveConfiguration: AcpRegistryRuntimeCoordinator["Service"]["publishLiveConfiguration"] =
(instanceId, configuration) =>
Ref.update(liveConfigurationByInstance, (current) =>
new Map(current).set(instanceId, configuration),
).pipe(
Effect.andThen(
Ref.modify(liveConfigurations, (state) => {
const revision = state.nextRevision + 1;
const entries = new Map(state.entries);
entries.set(instanceId, { configuration, revision });
return [revision, { nextRevision: revision, entries }] as const;
}).pipe(
Effect.flatMap((revision) =>
PubSub.publish(liveConfigurationUpdates, {
instanceId,
configuration,
revision,
}),
),
Effect.asVoid,
);

const getLiveConfigurationWithRevision: AcpRegistryRuntimeCoordinator["Service"]["getLiveConfigurationWithRevision"] =
Effect.fn("AcpRegistryRuntimeCoordinator.getLiveConfigurationWithRevision")(
function* (instanceId) {
const state = yield* Ref.get(liveConfigurations);
const entry = state.entries.get(instanceId);
return {
configuration: Option.fromNullishOr(entry?.configuration),
revision: entry?.revision ?? state.nextRevision,
};
},
);

const getLiveConfiguration: AcpRegistryRuntimeCoordinator["Service"]["getLiveConfiguration"] =
Effect.fn("AcpRegistryRuntimeCoordinator.getLiveConfiguration")(function* (instanceId) {
return Option.fromNullishOr((yield* Ref.get(liveConfigurationByInstance)).get(instanceId));
return (yield* getLiveConfigurationWithRevision(instanceId)).configuration;
});

const watchLiveConfiguration: AcpRegistryRuntimeCoordinator["Service"]["watchLiveConfiguration"] =
(instanceId, onUpdate) =>
(instanceId, onUpdate, options) =>
Effect.scoped(
Effect.gen(function* () {
const afterRevision = options?.afterRevision;
const subscription = yield* PubSub.subscribe(liveConfigurationUpdates);
const current = yield* getLiveConfiguration(instanceId);
if (Option.isSome(current)) {
yield* onUpdate(current.value);
const current = (yield* Ref.get(liveConfigurations)).entries.get(instanceId);
let deliveredRevision = afterRevision ?? 0;
if (
current !== undefined &&
(afterRevision === undefined || current.revision > afterRevision)
) {
deliveredRevision = current.revision;
yield* onUpdate(current.configuration);
}
yield* Stream.fromSubscription(subscription).pipe(
Stream.filter((update) => update.instanceId === instanceId),
Stream.runForEach((update) => onUpdate(update.configuration)),
Stream.runForEach((update) => {
if (update.revision <= deliveredRevision) return Effect.void;
deliveredRevision = update.revision;
return onUpdate(update.configuration);
}),
);
}),
);
Expand Down Expand Up @@ -344,8 +410,10 @@ const make = Effect.gen(function* () {
getAvailableCommands,
watchAvailableCommands,
clearLiveConfiguration,
clearLiveConfigurationIfRevision,
publishLiveConfiguration,
getLiveConfiguration,
getLiveConfigurationWithRevision,
watchLiveConfiguration,
requestUrlAuthentication,
acceptUrlAuthentication,
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.