Skip to content

Let leads and tasks run as other profiles, and profiles build on others - #296

Merged
lydakis merged 9 commits into
mainfrom
claude/project-thread-j9dmib
Oct 29, 2026
Merged

lydakis merged 9 commits into
mainfrom
claude/project-thread-j9dmib

Conversation

@lydakis

@lydakis lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What

lead.md and task.md are now the defaults of a setting rather than fixed names, and any profile can build on another. Sonny still ships only leads and tasks; any other kind of lead is a profile the person writes.

Which profile a lead / its tasks run as

What ~/.agent/config.toml .agents/project.toml
The profile a lead runs as [sonny] lead_profile profile
The profile every other agent is told [sonny] task_profile threads_profile

Precedence goes project file, then config, then lead / task. If the named profile doesn't exist, Sonny stops with profile_not_found and creates no agent.

Profiles build on profiles and carry skills

---
extends: lead
description: A lead that reviews each change before it lands
skills: [triage]
---
Review each change a task makes before it lands.
  • extends: NAME: the base's body comes first, then this one's. The base's model and tools apply where this profile sets none. Chains can go up to 8 deep. A circle fails with profile_invalid.
  • When a profile extends its own name, it builds on the file of that name it shadows. A folder's lead.md builds on the person's, and the person's builds on the one Sonny ships, so Sonny's updates keep coming. Sonny passes its shipped roles as built-ins (policy::profile_with).
  • skills: [a, b] comes from Claude Code's subagent front matter. Each skill's whole SKILL.md body is added after the role under ## Skill: NAME. A missing skill fails with skill_not_found. A role's files and skills are read within the instructions budget together.
  • A profile that extends lead or task is a variant of that role, so the Profiles index leaves it out, along with variants of those variants. Agents aren't offered them as peer roles.

Standards checked (2026-10-28)

  • Claude Code has an agent setting in settings.json and a --agent flag that pick the subagent profile the main session runs as. This PR's profile / lead_profile mirror it. Its subagent skills: key preloads whole skills, and this PR adopts it as is.
  • Codex custom agents (~/.codex/agents/*.toml) and Claude Code subagents each stand alone. Neither has a key for one profile building on another, and the agentskills.io spec has no skill-dependency key. That's why this PR uses extends, the name tsconfig and ESLint use.
  • Skills don't get a new key. The agent opens a skill itself, so a skill that builds on another can say so in its text.

Tests

  • policy::a_profile_builds_on_another_and_carries_skills covers chains, own-name shadowing down to the built-in, skill inheritance and dedupe, the shared budget, unclosed skill heads, index hiding (including variants of variants), circles, missing skills and bad names.
  • project::a_project_sets_the_profile_its_lead_runs_as (Sonny) covers the project file's profile, a missing profile and the composed # Role: my-lead.
  • task::a_task_is_told_who_it_works_for gains threads_profile cases. These cover explicit --profile of the task profile keeping its tools, task as an ordinary role, and same-name files that differ only in case.
  • The config and project-file readers have tests for the new keys.
  • cargo clippy --workspace --all-targets is clean. agent-client and Sonny unit tests pass. Three SandFS tests in sonny/tests/task.rs fail in the cloud container on main too, because the container has no FUSE.

One Codex index edge was deferred to #96: a self-extension whose shadowed file extends lead.

There's no screenshot because nothing visible changed.

🤖 Generated with Claude Code

A project's profile/threads_profile, else the config's [sonny]
lead_profile/task_profile, name the profile a lead runs as and the one
every other agent is told, with lead and task the defaults. Any profile
can build on another with extends (its own name builds on the file it
shadows, down to the one Sonny ships) and carry skills whole with
skills, Claude Code's subagent key. Variants of lead or task are not
offered as peer roles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX
@lydakis lydakis self-assigned this Oct 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-29T04:12:11.463790Z 84af837 New commits
🔒 Security Review ✅ Completed 2026-10-29T04:14:52.668966Z 84af837 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0aaa15e3c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/src/policy.rs Resolved
Comment thread client/src/policy.rs Resolved
Comment thread client/src/policy.rs Resolved
Comment thread sonny/src/task.rs Resolved
…ants of variants

Address the first Codex round on #296: a profile chain and the skills it
carries read no more than still fits in a bot's instructions; a carried
skill with an unclosed --- head fails like a profile's; a profile that
extends a lead variant is hidden from the index too; and --profile naming
the task profile keeps its model and tools while its body is told once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0973a5bf11

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/task.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8681c4e2b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sonny/src/task.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8881f7b6b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/src/policy.rs Resolved
A lead runs as it only when its project sets profile = "superlead". It
extends lead: the folder holds other projects, so the lead subscribes to
their leads and routes between them as between tasks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX
Carried from lead.md (#295 drops it there): the folder's projects' leads
report to it, and it hears them through one subscription naming each
lead exactly with updates on. Routing itself is the lead's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX
@lydakis
lydakis merged commit 210a101 into main Oct 29, 2026
3 checks passed
lydakis pushed a commit that referenced this pull request Oct 29, 2026
lydakis added a commit that referenced this pull request Oct 29, 2026
)

* Let leads and tasks run as other profiles, and profiles build on others

A project's profile/threads_profile, else the config's [sonny]
lead_profile/task_profile, name the profile a lead runs as and the one
every other agent is told, with lead and task the defaults. Any profile
can build on another with extends (its own name builds on the file it
shadows, down to the one Sonny ships) and carry skills whole with
skills, Claude Code's subagent key. Variants of lead or task are not
offered as peer roles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Bound a role's files together, reject unclosed skill heads, hide variants of variants

Address the first Codex round on #296: a profile chain and the skills it
carries read no more than still fits in a bot's instructions; a carried
skill with an unclosed --- head fails like a profile's; a profile that
extends a lead variant is hidden from the index too; and --profile naming
the task profile keeps its model and tools while its body is told once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Tell a role named task in full when tasks are told another profile

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Tell a role's body once only when it is the task profile's own file

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Use a neutral example profile name

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Ship an opt-in superlead profile

A lead runs as it only when its project sets profile = "superlead". It
extends lead: the folder holds other projects, so the lead subscribes to
their leads and routes between them as between tasks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Give the superlead the leads-of-leads rule and the exact subscription

Carried from lead.md (#295 drops it there): the folder's projects' leads
report to it, and it hears them through one subscription naming each
lead exactly with updates on. Routing itself is the lead's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Sonny: offer the person's lead a merge when an upgrade meets an edited skill or role

Sonny never writes over a skill or role (lead.md, task.md) the person
edited, so an edited one quietly stopped getting Sonny's changes. Now
Sonny sets its new text beside the edit, in ~/.agent/sonny/upgrades,
keeps whole what it last wrote in ~/.agent/sonny/shipped (what an edit
started from), and queues a note to the first bot it opens after the
upgrade. The bot tells the person and offers to bring Sonny's changes
into their copy. Each new text is told once; the transcript shows the
note as one quiet row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Sonny: offer only text that changed, and claim the pending offers so one bot tells them

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

* Sonny: pending upgrade offers as one file each, claimed by rename into a fresh folder

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGEEJYxYSGKW4TF3BrX

---------

Co-authored-by: Claude <[email protected]>
@lydakis lydakis mentioned this pull request Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants