Skip to content

bug: an agent created from the creator's own repo with their own token comes out pull-only as "shared catalog template" #3545

Closed

Description

@obasilakis

Summary

An agent created from a repository the creator owns, with the creator's own saved personal GitHub token, is created pull-only. The create response says the repository "is a shared catalog template". The repository is in no catalog. The default "an agent owns its repository" outcome (working branch, auto-sync on, pause-schedules on) is therefore never reached without passing source_mode: false explicitly.

Build + row

v1.0.0-rc2 (96f88f982), release-test row B6 (Git sync & durability). Same code on dev.

Steps

  1. Save a personal GitHub token (Settings → MCP Keys → Personal GitHub Token) for account alice.
  2. Create a private repository alice/my-agent owned by that account, not listed in any template catalog.
  3. POST /api/agents with {"name": "t1", "template": "github:alice/my-agent"} as that user.

Expected

Per the GitHub Sync user doc ("Creating an agent with sync"): the repository is not a catalog template, its owner is the token's account, the token is the user's own, and it can push. The agent gets a working branch with auto-sync on. git_mode.pushes is true.

Actual

"git_mode": {"kind": "agent", "source_mode": true, "pushes": false,
  "reason": "alice/my-agent is a shared catalog template: pull-only. Fork it to your own repository to keep this agent's work in git"}

GET /api/agents/t1/git/auto-sync → auto_sync_enabled: false. The same request with "source_mode": false returns pushes: true and a trinity/<agent>/<id> branch, so the token and repository are fine.

Where

  • src/backend/services/template_service.py — get_github_template(). Its final branch ("Dynamic: repo not in any configured list but still a valid github: ID") builds and returns a template for every github: id. The function never returns None for one.
  • src/backend/services/agent_service/crud.py — the create path calls _apply_agent_kind_default(..., catalog_template=bool(gh_template)). Since gh_template is always truthy, catalog_template is always True, and the if catalog_template: branch returns pull-only before the ownership and push checks run. The "Dynamic GitHub template" branch of _resolve_github_repo_and_pat is unreachable for the same reason.
  • tests/unit/test_1484_create_agent_characterization.py — the own-repository cases set get_github_template.return_value = None # dynamic. The real function does not behave that way, so the tests pass against a stub that production never matches.

Acceptance criteria

  • catalog_template is true only for a repository that is in the configured list, the registry or the defaults; a repository resolved through the dynamic fall-through is not a catalog template.
  • Creating from an own, non-catalog repository with an own token returns git_mode.pushes: true with a working branch, auto-sync on and pause-schedules on.
  • A catalog template still comes out pull-only.
  • A test exercises the real get_github_template() for a non-catalog repository instead of a None stub.

Activity

  1. added
    priority-p1
    type-bug
    complexity-low
    on Oct 11, 2026
  2. obasilakis commented on Oct 11, 2026

    @obasilakis
    ContributorAuthor

    Decision for the 1.0 cut (@obasilakis): release note. This is not fixed before the cut.

  3. added
    status-ready
    on Oct 12, 2026
  4. self-assigned this
    on Oct 13, 2026
  5. removed
    status-ready
    on Oct 13, 2026
  6. obasilakis commented on Oct 13, 2026

    @obasilakis
    ContributorAuthor

    /claim

  7. github-actions commented on Oct 13, 2026

    @github-actions

    @obasilakis This issue is already assigned to obasilakis. Use /unclaim first if you want to take over.

  8. added
    status-in-dev
    on Oct 14, 2026
  9. removed
    status-in-dev
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p1type-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions