Skip to content

refactor(core): one child-agent launch contract #443

Closed

Description

@ajianaz

Problem

A child agent's identity is one concept spread over two crates. The parent (tole-core agents.rs, AgentStartTool::execute) sets TOLE_AGENT_DEPTH, TOLE_AGENT_ID, TOLE_AGENT_TOUCH_LOG, TOLE_MEMORY_NAMESPACE, TOLE_MEMORY, TOLE_AGENT_ROLE and TOLE_AGENT_HANDOFF as string literals; the child reads them back in tole-cli handoff.rs and sibling.rs, tool_roster::agent_depth, main.rs, and the depth marker is matched again in the spawn-yourself guard. Producer and consumers share no type, so a renamed variable compiles on both sides and silently breaks children; #380 and #383 each had to touch four modules.

Proposal

tole_core::child_env (not behind shell-tools): the variable names, ChildLaunch (what a parent passes: id, touch log, mailbox room, optional role + handoff file) with vars() for the child process, and the read-back helpers depth, sibling, role with today's validation (agent-id charset, role parsing, a role without a handoff path is no role). agent_start, the guard and every CLI reader use it; the public ENV_* constants stay as aliases. A round-trip test pins parent → child. No behaviour change.

Fifth item of the 2026-10-26 architecture review.

Activity

  1. added
    enhancement
    harness
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementharness

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions