mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 15:31:38 +08:00
fix(tui): address copilot review on #14103
- normalizeStatusBar: trim/lowercase + 'on' → 'top' alias so user-edited YAML variants (Top, " bottom ", on) coerce correctly - shift-tab yolo: no-op with sys note when no live session; success-gated echo and catch fallback so RPC failures don't report as 'yolo off' - tui_gateway config.set/get statusbar: isinstance(display, dict) guards mirroring the compact branch so a malformed display scalar in config.yaml can't raise Tests: +1 vitest for trim/case/on, +2 pytest for non-dict display survival.
This commit is contained in:
@@ -105,4 +105,11 @@ describe('normalizeStatusBar', () => {
|
||||
expect(normalizeStatusBar('sideways')).toBe('top')
|
||||
expect(normalizeStatusBar(42)).toBe('top')
|
||||
})
|
||||
|
||||
it('trims whitespace and folds case', () => {
|
||||
expect(normalizeStatusBar(' Bottom ')).toBe('bottom')
|
||||
expect(normalizeStatusBar('TOP')).toBe('top')
|
||||
expect(normalizeStatusBar(' on ')).toBe('top')
|
||||
expect(normalizeStatusBar('OFF')).toBe('off')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user