@commonlyai/cli 0.1.161 → 0.1.162

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/cli",
3
- "version": "0.1.161",
3
+ "version": "0.1.162",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -669,8 +669,8 @@ export const updateAgentConfiguration = async ({
669
669
  parseEnv = parseEnvironmentFile,
670
670
  adapterRegistry = { getAdapter, listAdapterNames },
671
671
  }) => {
672
- if (!record?.podId || !record?.agentName) {
673
- throw new Error('token record is missing podId/agentName — re-attach the agent');
672
+ if (!record?.agentName) {
673
+ throw new Error('token record is missing agentName — re-attach the agent');
674
674
  }
675
675
  const instanceId = record.instanceId || 'default';
676
676
  const runtime = {};
@@ -730,13 +730,23 @@ export const updateAgentConfiguration = async ({
730
730
  throw new Error('provide at least one of --adapter, --model, --effort, or --env');
731
731
  }
732
732
 
733
+ // The token's pod may be an attention room rather than an installation.
734
+ // Reuse Settings' owner-filtered projection instead of guessing from it.
735
+ const settings = await client.get(
736
+ `/api/registry/agents/${encodeURIComponent(record.agentName)}/manage-settings?instanceId=${encodeURIComponent(instanceId)}`,
737
+ );
738
+ const podId = settings?.runtimeManaged
739
+ ? settings.runtimeSourcePodId : settings?.writablePodId;
740
+ if (typeof podId !== 'string' || !podId.trim()) {
741
+ throw new Error('No writable runtime installation found for this agent; check its Settings and computer binding.');
742
+ }
733
743
  await client.patch(
734
- `/api/registry/pods/${record.podId}/agents/${record.agentName}`,
744
+ `/api/registry/pods/${encodeURIComponent(podId)}/agents/${encodeURIComponent(record.agentName)}`,
735
745
  { instanceId, config },
736
746
  );
737
747
  return {
738
748
  agentName: record.agentName,
739
- podId: record.podId,
749
+ podId,
740
750
  instanceId,
741
751
  changed: Object.keys(config),
742
752
  ...(runtime.adapter ? { adapter: runtime.adapter } : {}),