feat(cloud-agent): create GitHub-signed commits in cloud runs#2283
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
75ff8ae to
59c67ab
Compare
ab183fb to
988ae14
Compare
59c67ab to
e10d218
Compare
465d5df to
c8c1b8f
Compare
e10d218 to
af4129c
Compare
af4129c to
ed1b37b
Compare
c8c1b8f to
6e930dd
Compare
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/agent/src/adapters/codex/codex-agent.ts:587-590
The `meta?.taskId ?? meta?.persistence?.taskId` resolution pattern is duplicated verbatim in both `claude-agent.ts` (line 1101) and here. Extracting it to a small helper in `signed-commit-shared.ts` (or `utils/common.ts`) would satisfy the OnceAndOnlyOnce rule and keep the two adapters in sync if the fallback chain ever changes.
```suggestion
private applySignedCommit<
T extends { cwd?: string; mcpServers?: McpServer[]; _meta?: unknown },
>(request: T, meta: NewSessionMeta | undefined): T {
const taskId = resolveTaskId(meta);
```
Reviews (1): Last reviewed commit: "feat(cloud-agent): create GitHub-signed ..." | Re-trigger Greptile |
6e930dd to
114628d
Compare
ed1b37b to
c34db07
Compare
114628d to
fb90079
Compare
joshsny
approved these changes
May 21, 2026
| * Wraps the runtime-agnostic core in `@posthog/git/signed-commit`. Registered | ||
| * per cloud session in `claude-agent.ts`. | ||
| */ | ||
| export function createSignedCommitMcpServer( |
Contributor
There was a problem hiding this comment.
can we do a standard MCP server for all these local tools we'll want, instead of one for each? small thing but it'd be nice to let other folks add tools easily to a general local mcp server
c34db07 to
ecbb810
Compare
fb90079 to
0f102dc
Compare
Wire the git_signed_commit MCP tool into the Claude (in-process) and Codex (stdio) adapters via a shared definition. Block git commit/push in cloud runs with a PreToolUse guard and update the cloud system prompt to commit through the tool.
ecbb810 to
31db29c
Compare
0f102dc to
bdf1fc8
Compare
Replace the per-tool MCP servers (signed-commit) with a single general 'posthog-local' server driven by a shared tool registry, so new local tools are added with one registry entry and exposed on both the Claude (in-process) and Codex (stdio) adapters automatically.
bdf1fc8 to
39665b5
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
The cloud agent must create GitHub-signed commits across both the Claude and Codex adapters
Changes
Wires the
git_signed_commitMCP tool into the agent:signed-commit-shared.ts) used by both adaptersgit addand commit through the tool