fix(mcp): remove default profile session cleanly#327
Merged
Conversation
Deploying with
|
| 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 |
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.
Motivation
defaultMCP profile could leave a legacy top-levelsessionin the persisted config, andnormalizeConfig()would rehydrateprofiles.default, causing a removed bearer token to remain on disk. This is a local credential-hygiene bug.Description
sessionwhen removing thedefaultprofile by updatingremoveProfile()to dropsessionfor that case sonormalizeConfig()cannot re-createprofiles.default. (change inpackages/gittensory-mcp/bin/gittensory-mcp.js)removes the default profile without rehydrating its legacy session tokenthat seeds a config with bothprofiles.default.sessionand a legacy top-levelsession, invokesprofile remove default, and asserts the default token is removed while other profiles remain. (added totest/unit/mcp-cli.test.ts)Testing
npm test -- test/unit/mcp-cli.test.ts -t "removes the default profile", which passed.npm run typecheckwhich completed successfully.profiles.default.sessionand the legacysession, runsgittensory-mcp profile remove default --jsonagainst that config, and confirmed the saved config no longer contains the default token.npm test -- test/unit/mcp-cli.test.tswas 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