hermes - ✅(Solved) Fix Settings UI: fallback_providers renders as "[object Object], [object Object]" in General settings [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#25352Fetched 2026-05-14 03:47:05
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4cross-referenced ×2commented ×1

The Fallback Providers field in the General settings tab displays [object Object], [object Object], ... instead of readable provider data. Saving from this state would corrupt the config.

Root Cause

AutoField.tsx handles the "list" schema type with a plain text input using Array.join():

// web/src/components/AutoField.tsx
if (schema.type === "list") {
  return (
    <Input
      value={Array.isArray(value) ? value.join(", ") : String(value ?? "")}
      onChange={(e) =>
        onChange(
          e.target.value
            .split(",")
            .map((s) => s.trim())
            .filter(Boolean),
        )
      }
      placeholder="comma-separated values"
    />
  );
}

fallback_providers is a list of objects ([{provider: "openai-codex", model: "gpt-5.5"}, ...]). JavaScript's Array.prototype.join() calls .toString() on each element, which returns [object Object] for plain objects.

The onChange handler compounds the problem: splitting on commas and returning plain strings would replace the list of provider objects with ["[object Object]", " [object Object]"] on save.

Fix Action

Fix

Display: map each object through JSON.stringify before joining. Parse: attempt JSON.parse on each token when splitting back.

if (schema.type === "list") {
  const listDisplay = Array.isArray(value)
    ? value.map((item) =>
        typeof item === "object" && item !== null ? JSON.stringify(item) : String(item),
      ).join(", ")
    : String(value ?? "");
  return (
    <Input
      value={listDisplay}
      onChange={(e) =>
        onChange(
          e.target.value
            .split(/,(?![^{[]*[}\]])/g)
            .map((s) => {
              const t = s.trim();
              if (!t) return undefined;
              try { return JSON.parse(t); } catch { return t; }
            })
            .filter((v) => v !== undefined && v !== ""),
        )
      }
      placeholder="comma-separated values"
    />
  );
}

Note: the regex /,(?![^{[]*[}\]])/g avoids splitting on commas inside nested JSON objects/arrays.

PR fix notes

PR #25376: fix(web): AutoField list type renders objects as [object Object]

Description (problem / solution / changelog)

Summary

Fixes the fallback_providers field in Settings UI rendering as [object Object], [object Object] instead of readable JSON. Saving from this state would corrupt the config by replacing provider objects with literal strings.

Problem

AutoField.tsx handles the "list" schema type with a plain text input using Array.join(", "). When list items are objects (like fallback_providers: [{provider: "openai", model: "gpt-5.5"}, ...]), JavaScript's .toString() returns [object Object] for each element.

The onChange handler compounds the issue: splitting on commas and returning plain strings replaces the structured objects with garbage strings on save.

Fix

  • Display: serialize each item via JSON.stringify() before joining (primitives are unaffected)
  • Parse: use JSON.parse() on each token when splitting back, with a regex /,(?![^{[]*[}\]])/g that avoids splitting on commas inside JSON braces/brackets
  • Helper functions serializeListItem() and parseListInput() are extracted for clarity

Testing

  • Verified that primitive lists (strings, numbers) behave identically to before
  • Object lists now display as readable JSON and round-trip correctly through edit → save

Closes #25352

Changed files

  • web/src/components/AutoField.tsx (modified, +34/-9)

Code Example

// web/src/components/AutoField.tsx
if (schema.type === "list") {
  return (
    <Input
      value={Array.isArray(value) ? value.join(", ") : String(value ?? "")}
      onChange={(e) =>
        onChange(
          e.target.value
            .split(",")
            .map((s) => s.trim())
            .filter(Boolean),
        )
      }
      placeholder="comma-separated values"
    />
  );
}

---

if (schema.type === "list") {
  const listDisplay = Array.isArray(value)
    ? value.map((item) =>
        typeof item === "object" && item !== null ? JSON.stringify(item) : String(item),
      ).join(", ")
    : String(value ?? "");
  return (
    <Input
      value={listDisplay}
      onChange={(e) =>
        onChange(
          e.target.value
            .split(/,(?![^{[]*[}\]])/g)
            .map((s) => {
              const t = s.trim();
              if (!t) return undefined;
              try { return JSON.parse(t); } catch { return t; }
            })
            .filter((v) => v !== undefined && v !== ""),
        )
      }
      placeholder="comma-separated values"
    />
  );
}
RAW_BUFFERClick to expand / collapse

Summary

The Fallback Providers field in the General settings tab displays [object Object], [object Object], ... instead of readable provider data. Saving from this state would corrupt the config.

Root Cause

AutoField.tsx handles the "list" schema type with a plain text input using Array.join():

// web/src/components/AutoField.tsx
if (schema.type === "list") {
  return (
    <Input
      value={Array.isArray(value) ? value.join(", ") : String(value ?? "")}
      onChange={(e) =>
        onChange(
          e.target.value
            .split(",")
            .map((s) => s.trim())
            .filter(Boolean),
        )
      }
      placeholder="comma-separated values"
    />
  );
}

fallback_providers is a list of objects ([{provider: "openai-codex", model: "gpt-5.5"}, ...]). JavaScript's Array.prototype.join() calls .toString() on each element, which returns [object Object] for plain objects.

The onChange handler compounds the problem: splitting on commas and returning plain strings would replace the list of provider objects with ["[object Object]", " [object Object]"] on save.

Fix

Display: map each object through JSON.stringify before joining. Parse: attempt JSON.parse on each token when splitting back.

if (schema.type === "list") {
  const listDisplay = Array.isArray(value)
    ? value.map((item) =>
        typeof item === "object" && item !== null ? JSON.stringify(item) : String(item),
      ).join(", ")
    : String(value ?? "");
  return (
    <Input
      value={listDisplay}
      onChange={(e) =>
        onChange(
          e.target.value
            .split(/,(?![^{[]*[}\]])/g)
            .map((s) => {
              const t = s.trim();
              if (!t) return undefined;
              try { return JSON.parse(t); } catch { return t; }
            })
            .filter((v) => v !== undefined && v !== ""),
        )
      }
      placeholder="comma-separated values"
    />
  );
}

Note: the regex /,(?![^{[]*[}\]])/g avoids splitting on commas inside nested JSON objects/arrays.

Additional Note

A structured editor (add/remove/reorder rows with provider + model inputs) would be a better long-term UX for this field than a raw JSON text input, but the above fix at minimum prevents data corruption.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix Settings UI: fallback_providers renders as "[object Object], [object Object]" in General settings [1 pull requests, 1 comments, 2 participants]