bug: TOML [agents.X] section name with dash crashes load-project.sh #862

Closed
opened 2026-04-16 11:22:16 +00:00 by dev-bot · 0 comments
Collaborator

Problem

projects/disinto.toml currently contains this workaround:

# DISABLED (dash in section name crashes load-project.sh — see issue)
# [agents.dev-qwen2]
# base_url = "http://10.10.10.1:8081"
# ...

Section keys in TOML can contain dashes ([agents.dev-qwen2] is valid TOML), but lib/load-project.sh chokes on them and was never updated. disinto hire-an-agent dev-qwen2 ... emits such a section, which then has to be manually disabled to keep the factory from crashing.

Why it bites

  • Any operator who runs hire-an-agent with a dashed agent name (the natural naming convention: dev-qwen2, dev-qwen3, review-qwen) produces an unparseable TOML.
  • The downstream compose regenerator relies on [agents.*] sections being parseable. With the section disabled, the new agent's service block disappears on next disinto up, silently dropping the container.

Fix

  1. Make load-project.sh handle dashed section names. The parser is Python-based (tomllib or equivalent) — dashes are already legal per spec, so the issue is likely in how the emitted bash-var keys are derived (dashes → invalid shell identifiers). Normalize via tr 'a-z-' 'A-Z_' (same convention as #852, #834).
  2. Make hire-an-agent validate the agent name against what load-project.sh / generators.sh can handle, and reject at hire-time with a clear error — don't write a TOML section that will crash downstream.
  3. Remove the DISABLED block in projects/disinto.toml once the fix lands.

Acceptance

  • [agents.dev-qwen2] (or any dashed name) parses cleanly through load-project.sh
  • Compose regeneration emits agents-dev-qwen2 service stanza without error
  • The # DISABLED workaround in projects/disinto.toml can be removed
  • Existing dashless agent names unaffected

Affected files

  • lib/load-project.sh — dash-to-underscore normalization for emitted keys
  • lib/hire-agent.sh — pre-hire validation
  • projects/disinto.toml — remove workaround block

Context

Caught during same dev-qwen2 hiring debugging session that surfaced #856 (missing collaborator), #855 (missing FACTORY_REPO env), #847, and the entrypoint ordering bug filed alongside this one. All part of the "hire-a-new-agent silently fails in multiple ways" pattern.

## Problem `projects/disinto.toml` currently contains this workaround: ```toml # DISABLED (dash in section name crashes load-project.sh — see issue) # [agents.dev-qwen2] # base_url = "http://10.10.10.1:8081" # ... ``` Section keys in TOML can contain dashes (`[agents.dev-qwen2]` is valid TOML), but `lib/load-project.sh` chokes on them and was never updated. `disinto hire-an-agent dev-qwen2 ...` emits such a section, which then has to be manually disabled to keep the factory from crashing. ## Why it bites - Any operator who runs `hire-an-agent` with a dashed agent name (the natural naming convention: `dev-qwen2`, `dev-qwen3`, `review-qwen`) produces an unparseable TOML. - The downstream compose regenerator relies on `[agents.*]` sections being parseable. With the section disabled, the new agent's service block disappears on next `disinto up`, silently dropping the container. ## Fix 1. Make `load-project.sh` handle dashed section names. The parser is Python-based (`tomllib` or equivalent) — dashes are already legal per spec, so the issue is likely in how the emitted bash-var keys are derived (dashes → invalid shell identifiers). Normalize via `tr 'a-z-' 'A-Z_'` (same convention as #852, #834). 2. Make `hire-an-agent` validate the agent name against what `load-project.sh` / `generators.sh` can handle, and reject at hire-time with a clear error — don't write a TOML section that will crash downstream. 3. Remove the `DISABLED` block in `projects/disinto.toml` once the fix lands. ## Acceptance - [ ] `[agents.dev-qwen2]` (or any dashed name) parses cleanly through `load-project.sh` - [ ] Compose regeneration emits `agents-dev-qwen2` service stanza without error - [ ] The `# DISABLED` workaround in `projects/disinto.toml` can be removed - [ ] Existing dashless agent names unaffected ## Affected files - `lib/load-project.sh` — dash-to-underscore normalization for emitted keys - `lib/hire-agent.sh` — pre-hire validation - `projects/disinto.toml` — remove workaround block ## Context Caught during same dev-qwen2 hiring debugging session that surfaced #856 (missing collaborator), #855 (missing FACTORY_REPO env), #847, and the entrypoint ordering bug filed alongside this one. All part of the "hire-a-new-agent silently fails in multiple ways" pattern.
dev-bot added the
backlog
priority
labels 2026-04-16 11:22:16 +00:00
dev-bot self-assigned this 2026-04-16 11:46:52 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-16 11:46:53 +00:00
dev-bot removed their assignment 2026-04-16 12:16:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#862
No description provided.