Skip to content

Daemon must resolve model from profile config.yaml at spawn #147

Description

@donovan-yohan

Problem

hermes_bridge/__main__.py:350 reads model from os.environ.get(\"BELAYER_MODEL\", \"\"). The profile fork's config.yaml#model.default (written at materialization in internal/daemon/profiles.go:497-501) is never consulted at spawn time.

Daemon side at internal/bridge/bridge.go:190-192 only emits BELAYER_MODEL when cfg.Model != \"\". If the operator hasn't set a model on the daemon, the bridge passes no model kwarg to AIAgent, and the underlying transport posts an empty model field — Nous (and other providers) reject with HTTP 400 "Model parameter is required".

Symptom (from parley playtest)

bridge:failed
final_response: None
POST body: {\"model\": \"\", ...}

Workaround today: start daemon with BELAYER_MODEL=moonshotai/kimi-k2.6 belayer daemon .... This forces the same model on every talent in the crag — no per-talent model selection.

Proposed fix

Daemon's spawn path should:

  1. Read the active profile fork's <fork>/config.yaml#model.default.
  2. Export as BELAYER_MODEL for that bridge subprocess.
  3. Per-talent override (later): allow talent.yaml#model to win over profile default.

Bridge code stays unchanged. Single-side fix in daemon.

Files

  • internal/bridge/bridge.go:188-192 — model env emission
  • internal/daemon/profiles.go:497-501formatProfileConfig (already writes model into the fork)
  • internal/daemon/agents.go — spawn path that builds bridge config

Acceptance

  • Daemon reads profile config.yaml#model.default and exports as BELAYER_MODEL when daemon's BELAYER_MODEL is unset.
  • Test: spawn agent into a profile fork that has model.default: foo/bar, assert bridge subprocess receives BELAYER_MODEL=foo/bar.
  • Test: explicit operator BELAYER_MODEL overrides profile default (operator wins).
  • Test: missing model.default in profile config → empty BELAYER_MODEL → bridge omits kwarg (current behavior preserved).

Reference

  • Parley devlog: ~/Documents/Programs/personal/parley/docs/devlogs/2026-05-04-belayer-profile-coupling-live-playtest.md — Gap 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture and designbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions