fix: resolve 3 bugs (#3366, #3272, #3222)

- shell-env: detect Git Bash via MSYSTEM env var when SHELL is unset (#3366)
  On some Git Bash installations SHELL is not set but MSYSTEM (MINGW64/MSYS)
  is always present. Check MSYSTEM before PSModulePath to avoid emitting
  PowerShell syntax in bash shells.

- session-state: resolve legacy agent names in resolveRegisteredAgentName (#3272)
  Historical sessions stored agent names like 'Sisyphus (Ultraworker)' which
  don't match the current registered format. Fall back to getAgentConfigKey
  for legacy/parenthesized name resolution before returning the raw name.

- config-migration: skip backup when file content is unchanged (#3222)
  Compare serialized config with existing file content before creating a
  timestamped .bak file. Only create backup when the on-disk content
  actually differs from the migrated content.
This commit is contained in:
YeonGyu-Kim
2026-04-15 10:43:44 +09:00
parent 54a94d4169
commit 0dab3116b7
7 changed files with 172 additions and 13 deletions
@@ -150,6 +150,28 @@ describe("claude-code-session-state", () => {
expect(resolveRegisteredAgentName("Atlas - Plan Executor")).toBe("\u200B\u200B\u200B\u200BAtlas - Plan Executor")
})
test("should resolve legacy parenthesized names to registered agent", () => {
// given - agent registered with new display name format
registerAgentName("\u200BSisyphus - Ultraworker")
// when - historical session has old parenthesized format
const resolved = resolveRegisteredAgentName("Sisyphus (Ultraworker)")
// then - resolves to registered name via config key lookup
expect(resolved).toBe("\u200BSisyphus - Ultraworker")
})
test("should resolve bare lowercase name from historical session", () => {
// given - agent registered with new display name
registerAgentName("Prometheus - Plan Builder")
// when - old session stored just "prometheus"
const resolved = resolveRegisteredAgentName("prometheus")
// then
expect(resolved).toBe("Prometheus - Plan Builder")
})
describe("#given atlas display name with zero-width prefix", () => {
describe("#when checking registration without the zero-width prefix", () => {
test("#then it treats the display name as registered", () => {