Skip to content

[Feature] Per-User Git Identity for Agent Workspaces — Commits incorrectly attributed to workspace owner #173

Description

@purvajaposhture

Summary

When multiple users work through Levi (Paperclip) agent workspaces, all Git commits and merged PRs are attributed to a single Git identity (currently AnilChinchawale) instead of the actual user who triggered the work. This makes contributor tracking impossible and breaks GitHub's contributor insights.

Background & Motivation

  • Levi runs agents in shared workspaces with a global git config user.name/email set to one person
  • When agents auto-commit and merge PRs, they use that global identity
  • The .mailmap file only maps the original Paperclip author (Dotta)
  • No per-user or per-agent Git identity configuration exists in companies/opea/agents/*/AGENTS.md or doc/DEVELOPING.md
  • This affects all team members — everyone has provided their email IDs but they aren't being used

Proposed Solution

Environment Variable Injection (recommended)

  1. Add gitName and gitEmail fields to user profiles (one-time setup per user)
  2. Inject GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL into the agent workspace environment when it boots, based on the logged-in human user who triggered the agent
  3. Agent commit logic reads these env vars instead of global user.name/user.email

Implementation Points

  • Modify packages/adapter-utils/src/server-utils.ts where PAPERCLIP_WORKSPACE_* env vars are constructed
  • Add:
    GIT_AUTHOR_NAME: user.gitName,
    GIT_AUTHOR_EMAIL: user.gitEmail,
  • Ensure agent Git operations (git commit, git merge) respect these env vars

Alignment with ROADMAP.md

  • Supports "Multiple Human Users" milestone (better multi-user support)
  • Aligns with "Agent Reviews and Approvals" (proper audit trails need correct attribution)

Alternatives Considered

Approach Pros Cons
Per-company .mailmap Simple, no code changes Static, needs manual updates for every new user
Manual git config per workspace Immediate fix Must run in every new repo/workspace, not scalable
Per-agent AGENTS.md identity Granular Overkill, most agents don't need unique identities

Implementation Phases

  1. Phase 1: Add gitName/gitEmail to user profile schema and UI
  2. Phase 2: Pass these values through workspace boot env vars
  3. Phase 3: Update agent Git commit/merge logic to prefer env vars over global config
  4. Phase 4: Backfill existing users, add to onboarding flow

Acceptance Criteria

  • Commits from agent workspaces show the triggering user's name/email
  • GitHub contributor graph correctly attributes commits to individual users
  • No manual git config required per workspace
  • Works for all companies/agents without per-agent configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions