gestalt-mobile 0.71.4 → 0.71.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7513,7 +7513,24 @@ describe('production composition', () => {
7513
7513
  relyingParty,
7514
7514
  installedCodexVersion: 'codex-cli 0.144.3',
7515
7515
  startAppServers: true,
7516
- launchAppServer: liveAppServer(handles),
7516
+ launchAppServer: () => {
7517
+ const launched = liveAppServer(handles)();
7518
+ handles.at(-1).respond = (method, params) => {
7519
+ if (method === 'thread/list')
7520
+ return {
7521
+ data: ['l1', 'l2', 'l3'].map((id) => ({
7522
+ id,
7523
+ parentThreadId: params.parentThreadId,
7524
+ status: { type: 'notLoaded' },
7525
+ source: { subAgent: { thread_spawn: { agent_path: `/root/${id}` } } },
7526
+ })),
7527
+ };
7528
+ if (method === 'thread/backgroundTerminals/list')
7529
+ throw new CodexJsonRpcError(-32600, `thread not found: ${params.threadId}`);
7530
+ return undefined;
7531
+ };
7532
+ return launched;
7533
+ },
7517
7534
  profiles: {
7518
7535
  list: async () => [],
7519
7536
  require: async () => ({
@@ -7584,6 +7601,20 @@ describe('production composition', () => {
7584
7601
  activeTurnId: null,
7585
7602
  desiredState: 'active',
7586
7603
  });
7604
+ // Recovery's activity refresh must inspect old workers without loading them
7605
+ // back into the replacement runtime and consuming its newly freed slots.
7606
+ await expect
7607
+ .poll(() => handles
7608
+ .filter((candidate) => candidate !== first)
7609
+ .flatMap((candidate) => candidate.requests))
7610
+ .toContainEqual({
7611
+ method: 'thread/read',
7612
+ params: { threadId: 'l1', includeTurns: false },
7613
+ });
7614
+ expect(handles
7615
+ .flatMap((candidate) => candidate.requests)
7616
+ .filter((request) => request.method === 'thread/resume' &&
7617
+ ['l1', 'l2', 'l3'].includes(request.params.threadId))).toEqual([]);
7587
7618
  await app.close();
7588
7619
  });
7589
7620
  it('drains an in-flight capacity recovery before closing its session database', async () => {
@@ -1116,18 +1116,21 @@ export class CodexSessionRuntime {
1116
1116
  }
1117
1117
  async withResolvedChildModels(resource, children) {
1118
1118
  for (const child of children) {
1119
- if (resource.spawnedAgentModels.has(child.id) ||
1119
+ if (child.model ||
1120
+ resource.spawnedAgentModels.has(child.id) ||
1120
1121
  resource.attemptedAgentModelRecovery.has(child.id))
1121
1122
  continue;
1122
- // thread/list omits the model for loaded and unloaded subagents alike.
1123
- // A spawn item can also contain null when an agent role selects or
1124
- // inherits the model, so thread/resume is the bounded authoritative read.
1123
+ // Roster reconciliation must not load historical children. Resuming them
1124
+ // just to read a model consumes agent slots (including pending_init slots
1125
+ // after a runtime recycle). Read metadata and leave missing models unknown.
1125
1126
  resource.attemptedAgentModelRecovery.add(child.id);
1126
1127
  try {
1127
- const response = await resource.process.rpc.request('thread/resume', {
1128
+ const response = await resource.process.rpc.request('thread/read', {
1128
1129
  threadId: child.id,
1130
+ includeTurns: false,
1129
1131
  });
1130
- const model = boundedString(asRecord(response)?.model, 256);
1132
+ const thread = asRecord(asRecord(response)?.thread);
1133
+ const model = thread?.id === child.id ? boundedString(thread.model, 256) : undefined;
1131
1134
  if (model)
1132
1135
  resource.spawnedAgentModels.set(child.id, model);
1133
1136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gestalt-mobile",
3
- "version": "0.71.4",
3
+ "version": "0.71.5",
4
4
  "description": "Mobile-first web relay for durable Codex development sessions",
5
5
  "keywords": [
6
6
  "codex",