Skip to content

Console spam when the dashboard session expires since v2.47.0 #4069

Closed

Description

@MrTroxyOfficial

Client or integration

OpenCodex dashboard

Area

Dashboard

Summary

Since v2.47.0, the console repeatedly prints NotAllowedError: Management session is no longer authorized while the dashboard is open. Each occurrence dumps the entire DOMException object, filling up the console.

It still happens on v2.48.0. I’d expect an expired dashboard session to disconnect quietly.

Reproduction

  1. Start OpenCodex and open http://localhost:10100/.
  2. Leave the dashboard connected through session expiry.
  3. Check the PowerShell console for repeated exceptions.

The source points to src/server/management/account-selection-stream.ts, where a failed authorization check calls controller.error(new DOMException(...)). This reproduces the console dump with the bundled Bun runtime.

Version

2.48.0, first observed on 2.47.0. Bundled Bun v1.4.0.

Operating system

Windows 10 Pro, build 19045, PowerShell.

Provider and model

Not provider-specific; this affects the dashboard’s account-update stream.

Logs or error output

NotAllowedError: Management session is no longer authorized
DOMException {
  code: 0,
  name: "NotAllowedError",
  message: "Management session is no longer authorized",
  ...
}

Screenshots and supporting files

A local patch resolved it by keeping pending updates in a bounded queue, checking authorization before delivery, and clearing the queue when closing the stream. Seven focused tests passed, including authorization loss and HTTP stream closure.

Updating to v2.48.0 overwrote that patch and brought the spam back.

Redacted configuration

Local dashboard at http://localhost:10100/. No provider-specific configuration appears necessary to reproduce this.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  2. lidge-jun commented on Sep 9, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 52 / 80

    설명

    이 이슈는 대시보드를 연 채로 관리 세션이 만료되면, PowerShell(번들 Bun) 콘솔에 NotAllowedError: Management session is no longer authorized와 DOMException 덤프가 반복으로 쌓인다는 보고입니다. 작성자 MrTroxy, 라벨 bug+gui, 재현은 v2.47.0부터·v2.48.0에서도 동일, Windows 10 + 로컬 http://localhost:10100/입니다. 지금 로컬 dev HEAD는 8026405d9(#4067), package 2.49.0입니다. 이 번호로 열린 구현 PR은 아직 없습니다. types/config 분할·preview와 무관합니다.

    원인은 HEAD의 src/server/management/account-selection-stream.ts에 그대로 있습니다. 계정 선택 SSE는 열 때뿐 아니라 매 프레임마다 validate()로 권한을 다시 봅니다. 권한이 없으면 controller.error(new DOMException(..., "NotAllowedError"))를 호출한 뒤 스트림을 닫습니다. 주석 의도(“에러로 큐에 남은 프레임도 비워서, 만료된 소비자가 나머지를 받지 못하게”)는 분명합니다. 문제는 그 에러가 Bun 런타임 콘솔에 DOMException 전체로 찍힌다는 점입니다. 하트비트가 15초마다 send(": heartbeat")를 호출하므로, 세션이 죽은 뒤에도 타이머/이벤트 경로가 같은 에러를 반복할 여지가 있습니다(닫히기 전·여러 연결). 작성자가 적은 로컬 패치(유계 큐 + 전달 전 권한 검사 + 닫을 때 큐 비우기)는 “error로 비우지 말고 close로 조용히 끝내자”는 방향과 같습니다.

    이력도 맞습니다. dd5aec571(“revalidate queued selection…”)에서 프레임마다 재검증과 controller.error(DOMException)가 들어갔습니다. 그 전에는 관리 경계에서 한 번만 막고 스트림 안에서는 재검증하지 않았습니다. 보안/일관성 쪽 수정이 콘솔 스팸 부작용을 만든 셈입니다. 대시보드 UX로는 세션 만료 후 재로그인이면 되고, 데이터 손실·라우팅 깨짐은 아닙니다. 다만 서버 콘솔을 들여다보는 Windows 사용자에게는 “앱이 계속 터진다”처럼 보여 지원 비용을 만듭니다. 2.49.0 tip(#4067 stop)과는 다른 축이라 열차 필수 항목은 아니지만, 범위가 한 파일·테스트 몇 개로 막을 수 있는 위생 버그입니다.

    고칠 때 지켜야 할 계약은 두 가지입니다. (1) 만료된 세션이 이미 enqueue된 account-selection 이벤트를 읽지 못하게 할 것. (2) 콘솔에는 예외 덤프를 남기지 말 것. 그래서 controller.error(DOMException) 대신 close()만 하거나, 필요하면 짧은 SSE 종료 이벤트 후 close가 맞습니다. error가 큐를 비우는 부작용에만 의존하지 말고, close 전에 구독 해제·heartbeat clear·connections 삭제로 전달을 끊으면 됩니다. 작성자 패치의 유계 큐는 desiredSize backpressure(highWaterMark: 16)와 겹칠 수 있으니, 최소 수정은 “unauthorized면 error 말고 close”가 우선입니다. 테스트는 권한 상실·HTTP abort·heartbeat 중 만료 세 경우를 콘솔/스트림 종료 관측으로 고정하면 됩니다.

    src/server/management/account-selection-stream.ts 라인 38-41 - 권한 실패 시 controller.error(DOMException). Bun이 콘솔에 객체 전체를 덤프하는 직접 원인이다.
    src/server/management/account-selection-stream.ts 라인 60 - 15초 heartbeat가 send를 다시 탄다. 만료 직후 반복 스팸 경로가 될 수 있다.
    src/server/management/account-selection-stream.ts 라인 46 - desiredSize backpressure로 느린 리더는 이미 close한다. 유계 큐를 새로 넣기 전에 이 경로와 역할을 나눠야 한다.
    경로 dd5aec571 - 프레임 재검증 도입 커밋. 보안 의도는 유지한 채 종료 방식만 바꿔야 한다.
    경로 구현 PR - 아직 없음. 작성자 로컬 패치는 참고용이지 리포에 올라오지 않았다.
    경로 관련 이슈 - #4055(원격 WebUI 세션 수명)는 “로그인 유지” 축이고, 이 이슈는 “만료 후 콘솔 소음” 축이다. 하나로 합치지 말 것.

    메인테이너의 판단이 필요한 지점

    • 최소 수정(error → 조용한 close)만 받을지, 작성자처럼 유계 큐까지 넣을지
    • 만료 시 클라이언트에 SSE 종료 이벤트를 보낼지, 연결만 끊고 GUI 재연결/재로그인에 맡길지
    • 2.49.0에 태울지, 다음 위생 배치로 미룰지

    너의 추천
    작은 버그픽스 PR을 받으세요. authorized() === false일 때 DOMException/controller.error를 쓰지 말고 구독·heartbeat를 정리한 뒤 close()만 하세요. 권한 상실·abort·heartbeat 중 만료 테스트를 넣고, Bun에서 콘솔 덤프가 없는지도 한 번 확인하세요. #4055와 묶지 마세요. types/config 분할 무관. 작성자에게는 “로컬 패치의 핵심(만료 시 조용히 닫기)을 upstream에 올릴 PR을 환영한다”고 답하면 됩니다.

    이 댓글은 grok-bot이 작성했습니다

  3. lidge-jun commented on Sep 9, 2026

    @lidge-jun
    Owner

    Fixed on dev via #4095 at 4a08c75.

  4. added a commit that references this issue on Sep 9, 2026
    589daec
  5. added a commit that references this issue on Sep 17, 2026
    14fc3c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingguiDashboard, tray, settings UI

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions