Skip to content

fix(agent): Reconnect signed-commit MCP server after session refresh#2724

Open
charlesvien wants to merge 4 commits into
mainfrom
fix/signed-commit-mcp-reconnect
Open

fix(agent): Reconnect signed-commit MCP server after session refresh#2724
charlesvien wants to merge 4 commits into
mainfrom
fix/signed-commit-mcp-reconnect

Conversation

@charlesvien

@charlesvien charlesvien commented Jun 17, 2026

Copy link
Copy Markdown
Member

Problem

In cloud runs, a session refresh disconnected the signed-commit MCP server (posthog-code-tools), so the agent could no longer commit and a turn's work appeared lost while raw git stays blocked.

Changes

  1. Rebuild a fresh in-process server on refresh instead of reusing the dead instance (the SDK rejects re-connecting it with "Already connected to a transport")
  2. Self-heal: reconnect the server before each prompt and when the guard hook blocks a raw git commit
  3. Bound the status check with a timeout so a wedged control channel can't stall the turn
  4. Clear stale MCP tool metadata cache on refresh and reconnect
  5. Honest guard-hook message when signing is briefly unavailable (changes are safe in the working tree)
  6. Tests for refresh rebuild, self-heal paths, status timeout, and guard wiring

How did you test this?

Manually

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@charlesvien charlesvien added Create Release This will trigger a new release Stamphog This will request an autostamp by stamphog on small changes labels Jun 17, 2026 — with Graphite App
@charlesvien charlesvien changed the title rebuild signed-commit server on session refresh fix(agent): Reconnect signed-commit MCP server after session refresh Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 9c3362c.

@charlesvien charlesvien marked this pull request as ready for review June 17, 2026 02:24

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR exceeds the auto-review size limit and has zero reviews. The behavioral changes — in-flight mutation of session MCP state, pre-prompt self-healing before every cloud turn, and cache clearing on reconnect — are non-trivial and warrant a domain expert sign-off before auto-approval.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jun 17, 2026
@greptile-apps

greptile-apps Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "simplify signed-commit heal and dedup te..." | Re-trigger Greptile

@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jun 17, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR exceeds the auto-review size limit (589 lines across 9 files), and the bot review flagged substantive behavioral concerns: in-flight mutation of session MCP state, pre-prompt self-healing before every cloud turn, and cache clearing on reconnect. These are non-trivial agent session management changes that need a domain expert sign-off.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jun 17, 2026

@joshsny joshsny 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.

Should we allow attempts for non-signed commits? We've had quite a few issues with the signed commit tool and it's not required on all repos, on the other hand it's nice to have this available as an MCP tool that we can track and later restrict the permissions for, will leave it for you to decide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Create Release This will trigger a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants