copilot-relay 0.3.4 → 0.3.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.
package/dist/main.js CHANGED
@@ -3650,7 +3650,7 @@ const renderStatus = (status$1) => {
3650
3650
  const health = status$1.health;
3651
3651
  lines.push(health?.ok ? ` health ok (${health.ms}ms)` : ` health FAILED${health?.detail ? ` — ${health.detail}` : ""}`);
3652
3652
  lines.push(status$1.models?.length ? ` models ${status$1.models.join(", ")}` : " models unavailable");
3653
- if (status$1.deep) lines.push(status$1.deep.ok ? ` upstream ok (${status$1.deep.ms}ms) — end-to-end Copilot round trip` : ` upstream FAILED${status$1.deep.detail ? ` — ${status$1.deep.detail}` : ""}`);
3653
+ if (status$1.deep) lines.push(status$1.deep.ok ? ` upstream ok (${status$1.deep.ms}ms) — ${status$1.deep.detail ?? "end-to-end Copilot round trip"}` : ` upstream FAILED${status$1.deep.detail ? ` — ${status$1.deep.detail}` : ""}`);
3654
3654
  else lines.push(" upstream not checked (use --deep)");
3655
3655
  lines.push(` log ${status$1.logPath}`, ` config ${status$1.configPath}`, ...renderConfig(status$1.config, true));
3656
3656
  if (status$1.health?.ok && status$1.deep && !status$1.deep.ok) lines.push("", " The relay is listening but cannot reach Copilot.", " Try: copilot-relay auth");
@@ -3740,11 +3740,19 @@ const checkDeep = async (baseUrl, model) => {
3740
3740
  ok: false
3741
3741
  };
3742
3742
  }
3743
- const content = result.body?.content;
3744
- return Array.isArray(content) && content.length > 0 ? {
3745
- ms: result.ms,
3746
- ok: true
3747
- } : {
3743
+ const body = result.body;
3744
+ if (Array.isArray(body?.content)) {
3745
+ if (body.content.length > 0) return {
3746
+ ms: result.ms,
3747
+ ok: true
3748
+ };
3749
+ if (body.type === "message" && body.role === "assistant" && body.stop_reason === "max_tokens" && typeof body.usage?.output_tokens === "number" && Number.isFinite(body.usage.output_tokens) && body.usage.output_tokens > 0) return {
3750
+ detail: "output budget exhausted before visible text",
3751
+ ms: result.ms,
3752
+ ok: true
3753
+ };
3754
+ }
3755
+ return {
3748
3756
  detail: "empty response",
3749
3757
  ms: result.ms,
3750
3758
  ok: false