Skip to content

feat(create-agent): prefill the name from the repository or template (abilityai/trinity-enterprise#964) - #3946

Merged
vybe merged 3 commits into
devfrom
feature/ent964-create-agent-name-prefill
Oct 26, 2026
Merged

vybe merged 3 commits into
devfrom
feature/ent964-create-agent-name-prefill

Conversation

@dolho

@dolho dolho commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Picking a GitHub source prefills the Create Agent dialog's Name, and so the permanent ID it derives, with the name that source already carries:
    • Import a GitHub repository: the repo name without the owner (Abilityai/trinity-pm → trinity-pm), for owner/repo, URL and .git input and every import intent.
    • A GitHub template: its template.yaml name:, else its repo name. This covers featured fork-to-own templates and templates preselected by Library → Use Template.
  • The person's input always wins: a hand-typed Name is never replaced, a Name still equal to the previous prefill follows the new source, and an ID override is kept.
  • Unchanged:
    • Blank and local templates start empty as before.
    • A repo name that sanitizes to nothing leaves Name empty, and submit shows the usual error.
    • The create payload is the same, and the backend remains the authority on sanitization.

Changes

  • src/backend/services/template_service.py: GitHub catalog entries gain agent_name, the declared name: alone. display_name can't carry it, because it resolves the admin's title, then the template's display_name, then name:.
  • src/frontend/src/components/CreateAgentModal.vue:
    • sourceName (computed): the name the picked source carries.
    • A watch that writes it into Name only while Name is empty or still equals the last prefill.
  • Docs: requirements/core-agent.md §1.1 and feature-flows/agent-lifecycle.md.

Test Plan

  • cd tests && pytest unit/test_ent964_template_agent_name.py: 13 cases (declared, admin title ignored, trimmed, capped, and none for missing, blank, non-string or a non-mapping template.yaml). All red before the change.
  • npx vitest run tests/unit/createAgentNamePrefill964.spec.js: 20 cases, one or more per acceptance criterion. 14 were red before the change; the other 6 cover behaviour that must not change (Blank and local stay empty, typed names kept).
  • Mutation check: always overwriting Name fails 2 tests; dropping the owner stripping or the declared name fails 6.
  • Full frontend unit suite 6396/6396 (raw-color and loading-gate ratchets included); backend template tests 587 passed.
  • Manual: New agent → Import a GitHub repository → type owner/repo and Name shows repo; type your own name, change the repo, and your name stays.

Pre-existing, not changed here: parseGithubRepo cuts a repo URL at the first dot, so https://github.com/acme/trinity.docs becomes acme/trinity (the owner/repo form is fine). Filed as #3947; the prefill makes it visible as Name trinity.

Fixes abilityai/trinity-enterprise#964

🤖 Generated with Claude Code

…bilityai/trinity-enterprise#964)

Picking a GitHub source now prefills the Create Agent dialog's Name, and
so the permanent ID derived from it, with the name the source already
carries:
- Import a GitHub repository: the repo name without the owner, for
  owner/repo, URL and .git input and every import intent.
- A GitHub template: its template.yaml `name:`, else its repo name.

GitHub catalog entries gain `agent_name` (the declared `name:` alone,
trimmed and capped; None for anything but a non-blank string), since
`display_name` is the admin's or the template's catalog title.

A hand-typed Name is never replaced; a Name still equal to the previous
prefill follows the new source; an ID override is kept. Blank and local
templates start empty as before. A candidate that sanitizes to nothing
leaves Name empty. The create payload is unchanged.

Fixes Abilityai/trinity-enterprise#964

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dolho dolho added the ui PR touches the frontend UI — triggers Playwright e2e tests label Oct 26, 2026

@obasilakis obasilakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. Backend 13/13 and the mount spec 20/20 pass locally. Mutations (always overwrite, fill only when empty, return display_name as agent_name) each turn tests red.

One question for the issue author: AC #5 says copy sources keep an empty Name, while AC #1 says GitHub import prefills for any accepted form. The PR prefills on GitHub import with intent copy (CreateAgentModal.vue:500-503, spec it.each(['copy','fork'])). @vybe, which AC holds? If copy should stay empty, it's && importIntent.value !== 'copy' on the github-custom branch.

Non-blocking:

  • CreateAgentModal.vue:142: the ID preview line now appears the moment a GitHub source is picked (design contract principle 29). The manual browser check is still unticked; worth a look in both themes.
  • dev-ci is red (#3931); wait for green before merging.

@vybe

vybe commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

merge-train 2026-10-26: pushed dbd778916 to this branch — a merge of dev resolving the tests/registry.json append conflict (rebuilt from the git stages; both ent964 entries kept). No code change.

On obasilakis's open question (AC #5, "copy sources keep empty Name"): decided at the merge-train gate to merge as is — every GitHub import intent (clone/copy/fork) and fork-to-own templates prefill from the repo name; prefill never clobbers a typed name. AC #5 is read as covering Blank only, since the dialog has no other copy source.

…y.json rebuilt from stages (#3946)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vybe
vybe merged commit cb02d8c into dev Oct 26, 2026
25 checks passed
webmixgamer added a commit that referenced this pull request Oct 26, 2026
Conflicts (both sides appended): docs/memory/feature-flows.md (kept both index
rows, newest first) and tests/registry.json (kept both; every entry three-way
checked). #3936 and #3946 add no route this census sees as a hand-copied
self-gate and do not reference the old AGENT_CALLABLE table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants