fix(config): log RPC URL and core mode as strings, not object wrappers (#2459)

Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
This commit is contained in:
Mega Mind
2026-05-22 19:40:15 -07:00
committed by GitHub
co-authored by Steven Enamakel
parent 27bea247cf
commit 333bd52842
2 changed files with 16 additions and 1 deletions
@@ -457,6 +457,21 @@ describe('configPersistence', () => {
expect(getStoredCoreMode()).toBeNull();
});
it('logs the mode string directly, not an object wrapper', () => {
const spy = vi.spyOn(console, 'debug').mockImplementation(() => {});
try {
storeCoreMode('cloud');
const calls = spy.mock.calls.flat();
// Must NOT log an object like { mode } — that renders as [object Object]
const hasObjectArg = calls.some(arg => typeof arg === 'object' && arg !== null);
expect(hasObjectArg).toBe(false);
const modeArg = calls.find(arg => typeof arg === 'string' && arg === 'cloud');
expect(modeArg).toBe('cloud');
} finally {
spy.mockRestore();
}
});
it('falls back to the E2E default local mode when no marker has been written', async () => {
vi.resetModules();
vi.doMock('../config', () => ({
+1 -1
View File
@@ -292,7 +292,7 @@ export function getStoredCoreMode(): 'local' | 'cloud' | null {
export function storeCoreMode(mode: 'local' | 'cloud'): void {
try {
localStorage.setItem(CORE_MODE_STORAGE_KEY, mode);
console.debug('[configPersistence] Stored core mode:', { mode });
console.debug('[configPersistence] Stored core mode:', mode);
} catch {
console.warn('[configPersistence] Unable to store core mode in localStorage');
}