[codex] Add local tool trace toggle (#806)

* test: harden tool approval browser contract

* test: cover tool trace display edge cases

* test: cover resumed tool trace edge cases

* feat: hide tool traces by default

* Add local tool trace toggle

---------

Co-authored-by: Zhicheng Han <zhicheng.han@mathematik.uni-goettingen.de>
This commit is contained in:
ekko
2026-05-17 09:01:59 +08:00
committed by GitHub
parent 569ddc28da
commit 0c2bafc619
19 changed files with 975 additions and 29 deletions
+10 -1
View File
@@ -13,6 +13,7 @@ export interface MockedRequest {
interface MockHermesApiOptions {
tokenValidationStatus?: number
initialProfileName?: 'default' | 'research'
sessions?: unknown[]
}
const sampleModelGroup = {
@@ -102,7 +103,7 @@ export async function mockHermesApi(page: Page, options: MockHermesApiOptions =
}
if (pathname === '/api/hermes/sessions') {
await route.fulfill(jsonResponse({ sessions: [] }, tokenValidationStatus))
await route.fulfill(jsonResponse({ sessions: options.sessions ?? [] }, tokenValidationStatus))
return
}
@@ -249,6 +250,14 @@ function makeSocket(url, options) {
},
emit(event, payload) {
state.emitted.push({ event, payload })
if (event === 'resume') {
const sessionId = payload && payload.session_id
const resumes = window.__PW_CHAT_SOCKET_RESUMES__ || {}
const response = sessionId ? resumes[sessionId] : null
if (response) {
setTimeout(() => this.__trigger('resumed', response), 0)
}
}
return this
},
removeAllListeners() {