Skip to content

fix(dashboard): unwrap question replies for every Codex id - #1289

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
SaulMoro:fix/dashboard-codex-reply-ids
Oct 23, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
SaulMoro:fix/dashboard-codex-reply-ids

Conversation

@SaulMoro

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1287. The dashboard showed the answer from a Codex question reply only for the codex tool id. For tcodex and codex-internal, the session preview still showed the <send_user_message_question_reply> envelope and the question metadata, which is the #1286 symptom.

The unwrap was gated on normalizeToolName(tool) === 'codex'. normalizeToolName maps IDE tool names such as execute_command, not agent ids. The gate now uses the file's isCodexTool, which already decides the other Codex-specific paths in dashboard-collector.ts.

Three smaller points from the same function:

  • Empty answer: a reply whose answers are all empty ([{"answer":""}]) now keeps the prompt, so the turn is still counted. After fix(dashboard): show readable session previews #1287, the empty answer stripped to nothing and the event was dropped. It now records the event as main did before fix(dashboard): show readable session previews #1287.
  • Narrowing: each reply element is narrowed from unknown instead of any.
  • Regex: the envelope pattern no longer carries whitespace quantifiers inside the tags, because JSON.parse already skips that whitespace. With an open tag, 1000 spaces and no closing tag, the old pattern took 192 ms and the new one 0.05 ms. With 100,000 spaces the new one takes 0.09 ms.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Test Plan

  • npx tsc --noEmit passes
  • npm run lint passes
  • npx vitest run src/__tests__/dashboard-collector.test.ts: 176 passed. The tcodex, codex-internal and empty-answer cases failed before the fix.
  • Full npx vitest run was not run locally.

Real CLI, comparing a build of main (c15fc0db) with this branch. In an isolated HOME, each payload goes through teamai dashboard-report --stdin --tool <id>. Then the built teamai dashboard runs on a free port, and the result is read from /api/sessions:

Case main this PR
codex, answer Use the web interface. same
tcodex, answer envelope + questionItemId metadata Use the web interface.
codex-internal, answer envelope + questionItemId metadata Use the web interface.
codex, [{"answer":""}] no session recorded session recorded, envelope as summary
codex, secret in answer <REDACTED:gh_tok> xxx…, 200 chars same
codex, malformed JSON envelope kept same
claude, envelope envelope kept same

Every dashboard-report call and the curl exited 0.

Related Issues

Refs #1286, #1287

Notes for Reviewers

dashboard-collector.ts has its own isCodexTool, a substring check, next to the exact list in src/utils/tool-names.ts (CODEX_TOOL_IDS). This PR uses the local one so that every Codex check in the file agrees. Moving the file onto the shared list is a separate change.

@SaulMoro SaulMoro assigned SaulMoro and jeff-r2026 and unassigned SaulMoro Oct 22, 2026
@github-actions

Copy link
Copy Markdown

No findings in the specified PR diff.

The PR description includes sufficient real-CLI verification: built CLI runs through dashboard-report and dashboard, with results checked via /api/sessions for the affected cases. This satisfies the required end-to-end testing record.

No builds, tests, installs, or PR code were executed during this review.

@github-actions

Copy link
Copy Markdown

No findings in the specified PR diff. The earlier review also reported none.

The PR description documents sufficient real-CLI verification: built dashboard-report and dashboard runs, with /api/sessions results covering the affected tool IDs and empty-answer case. This satisfies the required end-to-end testing record.

Only the specified diff was read. No PR code, builds, tests, or installs were executed.

@jeff-r2026 jeff-r2026 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Reviewed the diff; merged locally onto main together with #1289/#1299/#1348/#1342, then ran tsc, build, the affected unit tests and e2e (redact, dashboard-collector, ai-client-openclaw, report-timeout, openclaw-ai-import): all passed.

@jeff-r2026
jeff-r2026 merged commit a56ce71 into Tencent:main Oct 23, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants