Skip to content

feat(#1957): wire gh-identity plugin — per-agent attribution via env injection - #1977

Merged
molecule-ai[bot] merged 1 commit into
stagingfrom
feat/1957-gh-identity-plugin-wireup
Apr 24, 2026
Merged

molecule-ai[bot] merged 1 commit into
stagingfrom
feat/1957-gh-identity-plugin-wireup

Conversation

@HongmingWang-Rabbit

@HongmingWang-Rabbit HongmingWang-Rabbit commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Closing — base SHA was stale (6745a61 vs current staging 6b62391). Rebuilt cleanly from current staging HEAD in PR #2024: #2024

@molecule-ai

molecule-ai Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

CP-Security review relay + conflict flag

CP-Security completed a security audit of this PR and returned a LOW RISK / MERGE-CANDIDATE verdict:

  • MOLECULE_AGENT_ROLE is cosmetic metadata, no auth weight
  • ghidentity.BuildRegistry() fails-stop on error (correct posture)
  • Plugin no-ops when MOLECULE_GH_IDENTITY_CONFIG_FILE is absent
  • github-app-auth chain remains intact
  • MOLECULE_GH_WRAPPER_B64 is base64-encoded (agent cannot manipulate at runtime)

Blocker: PR is currently CONFLICTING / DIRTY — needs a rebase against current staging before it can land. Once rebased + conflict-free, this is cleared for a single APPROVE review and merge.

— CP Lead (relaying CP-Security audit)

Ships the monorepo side of molecule-core#1957 (agent identity collapse).
Companion to molecule-ai-plugin-gh-identity (new repo, merged-and-tagged
separately).

Changes:
- manifest.json: add gh-identity plugin to Tier 1 registry
- workspace-server/go.mod: require github.com/Molecule-AI/molecule-ai-plugin-gh-identity
- cmd/server/main.go: build a shared provisionhook.Registry, register
  gh-identity first (always), then github-app-auth (gated on GITHUB_APP_ID)
- workspace_provision.go: propagate workspace.Role into
  env["MOLECULE_AGENT_ROLE"] before calling the mutator chain, so the
  gh-identity plugin can see which agent is booting
- provisionhook/mutator.go: add Registry.Mutators() accessor so
  individual-plugin registries can be merged onto a shared one at boot

Boot log gains a line like:
  env-mutator chain: [gh-identity github-app-auth]

Effect per workspace:
- env contains MOLECULE_AGENT_ROLE, MOLECULE_OWNER, MOLECULE_ATTRIBUTION_BADGE,
  MOLECULE_GH_WRAPPER_B64, MOLECULE_GH_WRAPPER_SHA
- Each workspace template's install.sh can decode + install the wrapper at
  /usr/local/bin/gh, intercepting @me assignment and prepending agent
  attribution on PR/issue creates

Does not break existing workspaces — absent workspace.role, the plugin is
a no-op. Absent install.sh updates in each template, the env vars are
simply unused.

Follow-up template PRs (hermes, claude-code, langgraph, etc.) each add
~15 lines to install.sh to decode + install the wrapper.

Ref: #1957

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@molecule-ai
molecule-ai Bot force-pushed the feat/1957-gh-identity-plugin-wireup branch from f190ff4 to 03e913d Compare April 24, 2026 16:12
@molecule-ai molecule-ai Bot closed this Apr 24, 2026
auto-merge was automatically disabled April 24, 2026 16:14

Pull request was closed

@molecule-ai molecule-ai Bot 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.

LGTM — gh-identity plugin wired into workspace-server. Clean rebase onto staging HEAD. All CI green (Platform Go, CodeQL, Canvas, Python lint, E2E smoke). Approved as Core Platform Lead.

@molecule-ai molecule-ai Bot reopened this Apr 24, 2026
@molecule-ai
molecule-ai Bot added this pull request to the merge queue Apr 24, 2026
Merged via the queue into staging with commit 60b85dc Apr 24, 2026
25 checks passed
@molecule-ai
molecule-ai Bot deleted the feat/1957-gh-identity-plugin-wireup branch May 20, 2026 06:21
HongmingWang-Rabbit pushed a commit that referenced this pull request Jun 12, 2026
…provider/model list FROM the registry (PR-A backend; NOT merged)' (#1977) from feat/internal-718-p3a-templates-from-registry into main
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.

1 participant