Skip to content

Git commit co-authorship â human as Author, agent as Committer #1001

@jrf0110

Description

@jrf0110

Parent

Part of #204 (Phase 4: Hardening)

Problem

Agent commits currently show Toast (gastown) <toast@gastown.local> as both author and committer (agent-runner.ts:84-87). There's no trace of the human who initiated the work. On GitHub/GitLab, these commits look like they came from a bot â the human gets no contribution credit, and there's no provenance trail for compliance ("who authorized this code?").

Solution

Dual-attribute every agent commit: the human who initiated the work is the Author, the agent is the Committer. This way GitHub contribution graphs credit the human, while the agent identity remains traceable.

Git environment variables

Currently in agent-runner.ts:84-87:

GIT_AUTHOR_NAME: `${request.name} (gastown)`,
GIT_AUTHOR_EMAIL: `${request.name}@gastown.local`,
GIT_COMMITTER_NAME: `${request.name} (gastown)`,
GIT_COMMITTER_EMAIL: `${request.name}@gastown.local`,

Change to:

GIT_AUTHOR_NAME: request.userName,          // "John Smith"
GIT_AUTHOR_EMAIL: request.userEmail,        // "john@company.com"
GIT_COMMITTER_NAME: `${request.name} (Polecat)`,
GIT_COMMITTER_EMAIL: `${request.name}@gastown.kilo.ai`,

Data flow

The user's name and email need to flow from the initiating action through to the agent:

  1. Mayor message or gt_sling: The userId of the human is already on the request. Resolve their name/email from the Kilo user record.
  2. Bead creation: Store initiated_by_user_id on the bead (or use the existing created_by field if it stores the userId).
  3. Agent dispatch: startAgentInContainer() passes userName and userEmail to the container alongside the existing agentName.
  4. Container: agent-runner.ts sets GIT_AUTHOR_* to the human, GIT_COMMITTER_* to the agent.

Co-authored-by trailers

In addition to the Author/Committer split, append trailers to commit messages:

Co-authored-by: Toast (Polecat) <toast@gastown.kilo.ai>
Requested-by: John Smith <john@company.com>
Bead-ID: gt-abc-123

This requires either:

  • Instructing the polecat's system prompt to include trailers in commit messages
  • Or post-processing commits via a git hook in the worktree

The prompt approach is simpler and more flexible. Add to the polecat system prompt's "Commit & Push Hygiene" section.

Acceptance Criteria

  • GIT_AUTHOR_NAME / GIT_AUTHOR_EMAIL set to the initiating user's name and email
  • GIT_COMMITTER_NAME / GIT_COMMITTER_EMAIL set to the agent's identity
  • User name/email resolved from Kilo user record and passed through dispatch
  • Polecat system prompt instructs agents to include Co-authored-by and Bead-ID trailers
  • GitHub/GitLab contribution graphs credit the human user
  • Agent identity remains visible in commit metadata

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestkilo-auto-fixAuto-generated label by Kilokilo-triagedAuto-generated label by Kilo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions