Skip to content

fix(mcp): remove default profile session cleanly#327

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-default-profile-removal-session-token
Jun 3, 2026
Merged

fix(mcp): remove default profile session cleanly#327
JSONbored merged 1 commit into
mainfrom
codex/fix-default-profile-removal-session-token

Conversation

@JSONbored
Copy link
Copy Markdown
Owner

Motivation

  • Removing the default MCP profile could leave a legacy top-level session in the persisted config, and normalizeConfig() would rehydrate profiles.default, causing a removed bearer token to remain on disk. This is a local credential-hygiene bug.

Description

  • Clear the legacy top-level session when removing the default profile by updating removeProfile() to drop session for that case so normalizeConfig() cannot re-create profiles.default. (change in packages/gittensory-mcp/bin/gittensory-mcp.js)
  • Add a regression test removes the default profile without rehydrating its legacy session token that seeds a config with both profiles.default.session and a legacy top-level session, invokes profile remove default, and asserts the default token is removed while other profiles remain. (added to test/unit/mcp-cli.test.ts)

Testing

  • Ran the targeted unit test: npm test -- test/unit/mcp-cli.test.ts -t "removes the default profile", which passed.
  • Ran type checks with npm run typecheck which completed successfully.
  • Verified manually with a small repro script that writes a config containing both profiles.default.session and the legacy session, runs gittensory-mcp profile remove default --json against that config, and confirmed the saved config no longer contains the default token.
  • A full run of npm test -- test/unit/mcp-cli.test.ts was attempted and reported two unrelated/flaky failures (decision-pack cache abort/timeout and an unsafe packet markdown timeout test); these failures are external to this change and the new regression test passes in isolation.

Codex Task

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 2, 2026
@github-actions github-actions Bot added the bug Something isn't working label Jun 2, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 2, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui ce2181c Commit Preview URL

Branch Preview URL
Jun 02 2026, 11:09 PM

@JSONbored JSONbored self-assigned this Jun 3, 2026
@JSONbored JSONbored merged commit de669a8 into main Jun 3, 2026
8 checks passed
@JSONbored JSONbored deleted the codex/fix-default-profile-removal-session-token branch June 3, 2026 04:44
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 3, 2026
@github-actions github-actions Bot mentioned this pull request Jun 3, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant