@songsid/agend 2.1.5-beta.20 → 2.1.5-beta.21

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.
@@ -33,7 +33,7 @@ import { processAttachments } from "./channel/attachment-handler.js";
33
33
  import { routeToolCall } from "./channel/tool-router.js";
34
34
  import { Scheduler } from "./scheduler/index.js";
35
35
  import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
36
- import { TopicCommands, saveCommandForBackend, parseSaveFilename, parsePauseWakeCommand, SAVE_FILENAME_RE, resolveInstanceContext, forgetInstanceContext } from "./topic-commands.js";
36
+ import { TopicCommands, saveCommandForBackend, parseSaveFilename, parsePauseWakeCommand, SAVE_FILENAME_RE, resolveInstanceContext, forgetInstanceContext, readStatuslineModel } from "./topic-commands.js";
37
37
  import { DailySummary } from "./daily-summary.js";
38
38
  import { WebhookEmitter } from "./webhook-emitter.js";
39
39
  import { TmuxControlClient } from "./tmux-control.js";
@@ -11077,11 +11077,9 @@ Plus the operational skills (fleet-health, instance-lifecycle, scheduling, sessi
11077
11077
  const instances = names.map(name => {
11078
11078
  const statusFile = join(this.getInstanceDir(name), "statusline.json");
11079
11079
  let cost = 0;
11080
- let model = "";
11081
11080
  try {
11082
11081
  const data = JSON.parse(readFileSync(statusFile, "utf-8"));
11083
11082
  cost = data.cost?.total_cost_usd ?? 0;
11084
- model = data.model?.display_name ?? "";
11085
11083
  }
11086
11084
  catch (err) {
11087
11085
  this.logger.debug({ err, name }, "statusline.json read failed (getUiStatus)");
@@ -11094,8 +11092,40 @@ Plus the operational skills (fleet-health, instance-lifecycle, scheduling, sessi
11094
11092
  ?? this.fleetConfig?.defaults?.backend
11095
11093
  ?? "claude-code");
11096
11094
  const { context } = resolveInstanceContext(this.dataDir, name, backend);
11097
- const context_pct = context ?? 0;
11098
- return { name, status: this.getInstanceStatus(name), context_pct, cost, model };
11095
+ // context_pct: null when unavailable, not 0
11096
+ const context_pct = context ?? null;
11097
+ // Model: Only Claude Code has live statusline; others use the effective resolver.
11098
+ // readStatuslineModel provides the /ctx-aligned display_name+id combo for Claude.
11099
+ // Non-Claude backends must NOT read statusline.json model (may be stale from previous Claude run).
11100
+ const resolved = this.resolveInstanceModel(name);
11101
+ const liveModel = backend === "claude-code" ? readStatuslineModel(this.dataDir, name) : null;
11102
+ // Display value: live model for Claude, resolved.display for others (includes "auto (default)" for Kiro)
11103
+ const model = liveModel ?? resolved.display;
11104
+ // model_source: "live" when Claude statusline succeeded, else the resolver's source
11105
+ const model_source = liveModel ? "live" : resolved.source;
11106
+ // Effort: aligned with /ctx's effortLineFor — unsupported and antigravity don't show effort.
11107
+ const effortStrategy = this.effortStrategyFor(name);
11108
+ const isAgy = backend === "antigravity" || backend === "agy";
11109
+ const effortResolved = this.resolveInstanceEffort(name);
11110
+ // Only show effort if backend supports it and it's not antigravity
11111
+ const effort = (effortStrategy === "unsupported" || isAgy) ? null : effortResolved.effort;
11112
+ const effort_source = (effortStrategy === "unsupported" || isAgy) ? null : effortResolved.source;
11113
+ // Display name: fleet config → classic channel → undefined
11114
+ const display_name = classic
11115
+ ? this.classicChannels?.getAll().find(ch => ch.instanceName === name)?.displayName
11116
+ : this.fleetConfig?.instances[name]?.display_name;
11117
+ return {
11118
+ name,
11119
+ display_name: display_name || undefined,
11120
+ status: this.getInstanceStatus(name),
11121
+ context_pct,
11122
+ cost,
11123
+ model,
11124
+ model_source,
11125
+ backend,
11126
+ effort,
11127
+ effort_source,
11128
+ };
11099
11129
  });
11100
11130
  return {
11101
11131
  instances,