impel-cli 0.20.18 → 0.20.20

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/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Release notes
2
2
 
3
+ ## 0.20.20 — Minimal Codex adapter tool surface
4
+
5
+ - Disables Codex's stable multi-agent feature inside qualified managed adapter
6
+ profiles, removing collaboration tool schemas that fixed-binding children and
7
+ single-thread launches cannot legitimately use.
8
+ - Advances the managed profile manifest so existing adapters refresh onto the
9
+ smaller, configuration-enforced tool surface immediately.
10
+
11
+ ## 0.20.19 — Recovered Codex stream accounting
12
+
13
+ - Counts a zero-exit, completed Codex turn with a final agent message and one
14
+ native-agent start as successful even when the host reports transient stream
15
+ retry events before recovering.
16
+ - Records recovered error-event counts separately in private attempt records
17
+ and aggregate analysis instead of silently discarding the successful sample.
18
+ - Prevents generated Codex specialists from using collaboration messages to
19
+ report their terminal result, and refreshes already-fresh managed profiles
20
+ onto the tightened adapter instructions.
21
+
3
22
  ## 0.20.18 — Recoverable Codex profiling cohorts
4
23
 
5
24
  - Widens the bounded retry window for transient current-tenant reads while
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impel-cli",
3
- "version": "0.20.18",
3
+ "version": "0.20.20",
4
4
  "description": "Prepare isolated Claude and Codex workspaces for every accessible Impel tenant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -89,6 +89,7 @@ export function summarizeCodexEvents(events) {
89
89
  let outputTokens = 0;
90
90
  let turnCompleted = false;
91
91
  let errorEvents = 0;
92
+ let agentMessages = 0;
92
93
  let codeCells = 0;
93
94
  let codeWaits = 0;
94
95
 
@@ -102,6 +103,7 @@ export function summarizeCodexEvents(events) {
102
103
 
103
104
  const item = eventItem(event);
104
105
  const itemType = safeEventType(item.type);
106
+ if (type === "item.completed" && itemType === "agent_message") agentMessages += 1;
105
107
  const tool = eventTool(item);
106
108
  increment(toolCounts, tool);
107
109
  if (itemType && /(?:code_mode|command_execution|code_cell)/u.test(itemType)) codeCells += 1;
@@ -123,6 +125,7 @@ export function summarizeCodexEvents(events) {
123
125
  threadCount: threads.size,
124
126
  turnCompleted,
125
127
  errorEvents,
128
+ agentMessages,
126
129
  codeCells,
127
130
  codeWaits,
128
131
  inputTokens,
@@ -410,6 +413,8 @@ export function analyzeAggregates(aggregates) {
410
413
  timeout: attempts.filter((attempt) => attempt.timedOut).length,
411
414
  invalidJson: attempts.filter((attempt) => !attempt.jsonValid).length,
412
415
  descendantsRemaining: attempts.filter((attempt) => attempt.descendantsRemaining === true).length,
416
+ attemptsWithRecoveredErrors: successful.filter((attempt) => (attempt.errorEvents || 0) > 0).length,
417
+ recoveredErrorEvents: successful.reduce((total, attempt) => total + (attempt.errorEvents || 0), 0),
413
418
  },
414
419
  };
415
420
  report.gates = report.mode === "direct" ? directGate(report) : compatibleGate(report);
@@ -374,7 +374,7 @@ function parseArguments(argv) {
374
374
  return { ...options, help: false };
375
375
  }
376
376
 
377
- function safeAttemptRecord({ options, index, processResult, summary, jsonValid, parseError }) {
377
+ export function safeAttemptRecord({ options, index, processResult, summary, jsonValid, parseError }) {
378
378
  const codex = summary?.codex || {};
379
379
  const telemetry = summary?.telemetry || {};
380
380
  const durationMs = processResult.endedAtMs - processResult.startedAtMs;
@@ -389,7 +389,7 @@ function safeAttemptRecord({ options, index, processResult, summary, jsonValid,
389
389
  && processResult.descendantsRemaining !== true
390
390
  && jsonValid
391
391
  && codex.turnCompleted === true
392
- && (codex.errorEvents || 0) === 0
392
+ && (codex.agentMessages || 0) >= 1
393
393
  && (telemetry.localFailures || 0) === 0
394
394
  && startCalls === 1;
395
395
  return {
@@ -412,6 +412,8 @@ function safeAttemptRecord({ options, index, processResult, summary, jsonValid,
412
412
  parseFailureClass: parseError ? "invalid-jsonl" : null,
413
413
  success,
414
414
  eventCount: codex.eventCount || 0,
415
+ agentMessages: codex.agentMessages || 0,
416
+ errorEvents: codex.errorEvents || 0,
415
417
  threadCount: codex.threadCount || 0,
416
418
  toolCounts: codex.toolCounts || {},
417
419
  parentToolCounts: codex.parentToolCounts || {},
package/src/agents.js CHANGED
@@ -52,7 +52,7 @@ export const NATIVE_AGENT_RUN_TOOL = "run_native_agent";
52
52
  export const NATIVE_AGENT_RESUME_TOOL = "resume_native_agent_run";
53
53
  export const NATIVE_AGENT_RECOVER_TOOL = "recover_native_agent_runs";
54
54
  export const MANAGED_AGENT_MCP_SERVER = "impel_agent";
55
- export const MANAGED_AGENT_MANIFEST_VERSION = 10;
55
+ export const MANAGED_AGENT_MANIFEST_VERSION = 12;
56
56
 
57
57
  const NATIVE_AGENT_TOOL_NAMES = [
58
58
  NATIVE_AGENT_RUN_TOOL,
@@ -650,6 +650,7 @@ function codexAdapterInstructions(tenantId, agent) {
650
650
  const callerGuidance = usesVerbatimRelay(agent)
651
651
  ? adapterCallerSpawnGuidance("Codex")
652
652
  : null;
653
+ const collaborationConstraint = `Collaboration tools are disabled. Return one final response to the caller after the native-agent transport reaches terminal.`;
653
654
  if (usesDirectAnswer(agent)) {
654
655
  const completionGuidance = usesVerbatimRelay(agent)
655
656
  ? adapterAnswerVerbatimCompletionGuidance()
@@ -657,6 +658,7 @@ function codexAdapterInstructions(tenantId, agent) {
657
658
  return [
658
659
  `You are a thin transport adapter for the exact Impel native agent ${JSON.stringify(agent.agentId)} in tenant ${JSON.stringify(tenantId)}.`,
659
660
  ...(callerGuidance ? [callerGuidance] : []),
661
+ collaborationConstraint,
660
662
  `Do not perform the assigned task yourself, do not delegate to any other agent, and do not independently synthesize the result.`,
661
663
  `Confirm that the assigned request fits the cataloged capabilities ${JSON.stringify(agent.capabilities)} and none of the exclusions ${JSON.stringify(agent.exclusions)} before answering.${contextRequirement}`,
662
664
  sideEffectInstruction,
@@ -671,6 +673,7 @@ function codexAdapterInstructions(tenantId, agent) {
671
673
  return [
672
674
  `You are a thin transport adapter for the exact Impel native agent ${JSON.stringify(agent.agentId)} in tenant ${JSON.stringify(tenantId)}.`,
673
675
  ...(callerGuidance ? [callerGuidance] : []),
676
+ collaborationConstraint,
674
677
  `Do not perform the assigned task yourself, do not delegate to any other agent, and do not independently synthesize or rewrite the result.`,
675
678
  `Confirm that the assigned request fits the cataloged capabilities ${JSON.stringify(agent.capabilities)} and none of the exclusions ${JSON.stringify(agent.exclusions)} before starting.${contextRequirement}`,
676
679
  sideEffectInstruction,
@@ -683,6 +686,7 @@ function codexAdapterInstructions(tenantId, agent) {
683
686
  function retiredAdapterInstructions(tenantId, agent) {
684
687
  return [
685
688
  `You are a recovery-only transport adapter for retired Impel native-agent binding ${JSON.stringify(agent.agentId)} in tenant ${JSON.stringify(tenantId)}.`,
689
+ `Collaboration tools are disabled. Return one final response to the caller after the native-agent transport reaches terminal.`,
686
690
  `You cannot start new work. Never call run_native_agent and never perform or recreate the assigned task yourself.`,
687
691
  `Call ${nativeToolName(NATIVE_AGENT_RECOVER_TOOL)} with {} to obtain integrity-validated pending handles for this fixed binding, then call ${nativeToolName(NATIVE_AGENT_RESUME_TOOL)} with the intended handle until it returns a terminal result. If multiple handles cannot be safely associated with the request, report them instead of choosing.`,
688
692
  `Return successful finalText byte-for-byte. For failure, return the preserved runId, output, and error without inventing a replacement result.`,
@@ -772,6 +776,9 @@ function renderCodexConfiguration({
772
776
  `developer_instructions = ${JSON.stringify(recoveryOnly ? retiredAdapterInstructions(tenantId, agent) : codexAdapterInstructions(tenantId, agent))}`,
773
777
  "",
774
778
  ...(directCodeMode ? [
779
+ "[features]",
780
+ "multi_agent = false",
781
+ "",
775
782
  "[features.code_mode]",
776
783
  "enabled = true",
777
784
  `direct_only_tool_namespaces = [${JSON.stringify(nativeToolNamespace())}]`,