Skip to content

feat(cli): open a specific eval by id - #10336

Open
seva9523 wants to merge 37 commits into
promptfoo:mainfrom
seva9523:feat/view-specific-eval
Open

seva9523 wants to merge 37 commits into
promptfoo:mainfrom
seva9523:feat/view-specific-eval

Conversation

@seva9523

@seva9523 seva9523 commented Aug 9, 2026 •

Copy link
Copy Markdown

Adds promptfoo view --id <evalId> to open a stored eval directly. Encodes the ID through viewer navigation and downstream table, rating, rename, copy, author, download, report, trace, and sharing requests so reserved characters do not select a different eval. Existing behavior is preserved when --id is omitted.

Empty IDs, exact dot segments, and literal hexadecimal percent escapes are rejected before server startup because the current path router cannot carry them unambiguously. The viewer guide documents this limitation and the verified promptfoo export eval fallback.

Validated against current main with 36,658 backend tests (10 existing skips), 5,970 Web UI tests, types, architecture, Knip, style, core/app/docs builds, and actual built-CLI runs covering five accepted ID forms, six rejected forms, and three export fallbacks. In the built browser, verified reserved-character, Unicode, backslash, and literal-percent IDs; persisted manual ratings, name and author edits; opened output details and an embedded redteam report; followed report logs with the plugin filter; and copied the selected eval. A final clean main integration passed the affected command/server and assertion tests and type check.

@codecov

codecov Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.73%. Comparing base (aaeebf2) to head (39cae0e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10336      +/-   ##
==========================================
- Coverage   89.73%   89.73%   -0.01%     
==========================================
  Files        1051     1051              
  Lines       92781    92795      +14     
  Branches    32855    32860       +5     
==========================================
+ Hits        83261    83271      +10     
- Misses       9520     9524       +4     
Flag Coverage Δ
backend 90.44% <100.00%> (-0.01%) ⬇️
site 53.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@seva9523
seva9523 marked this pull request as ready for review August 9, 2026 15:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 758e72e41f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/view.ts Resolved

seva9523 commented Aug 9, 2026

Copy link
Copy Markdown
Author

@codex address that feedback

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@seva9523
seva9523 marked this pull request as draft August 9, 2026 15:56

seva9523 commented Aug 9, 2026

Copy link
Copy Markdown
Author

@codex address that feedback

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@seva9523
seva9523 force-pushed the feat/view-specific-eval branch from e845a8c to 758e72e Compare August 9, 2026 16:26
@seva9523
seva9523 marked this pull request as ready for review August 9, 2026 16:32

seva9523 commented Aug 9, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9a0b6c1f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/view.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0632c3fab8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/app/src/utils/api.ts Resolved

Copy link
Copy Markdown
Author

Addressed the two remaining Codex P2 findings in c087d8f64:

  • v4 and legacy manual-rating requests now route eval IDs through getEvalApiPath(), with result IDs encoded separately;
  • affected ResultsTable, ResultsView, delete, and download test mocks now provide the new named export.

Fork-side validation passed on Node 24.19.0: 5 focused test files / 188 tests, root tsc --noEmit, Prettier, Biome, pre-commit checks, git diff --check, and a guard against raw manual-rating eval routes. The updated upstream workflow run is awaiting maintainer approval for this fork head.

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c087d8f64d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/view.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 766f93434d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/view.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bba62f2929

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread test/commands/view.dot-segments.test.ts Resolved
Comment thread src/commands/view.ts Resolved
Comment thread site/docs/usage/web-ui.md Resolved

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 402b15417f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b7ae789fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/docs/usage/web-ui.md Resolved
Comment thread site/docs/usage/web-ui.md Resolved
@seva9523
seva9523 force-pushed the feat/view-specific-eval branch from 1b7ae78 to aa29b49 Compare August 10, 2026 16:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb4eea0d9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/docs/usage/web-ui.md Resolved

Copy link
Copy Markdown
Author

@codex review

Final verification target: exact head bb4eea0d. Empty --id values are now rejected with a clean CLI error and a focused regression. Validate PR Title, Promptfoo Code Scan, and CI run #49652 all passed; 27 jobs succeeded, 2 conditional jobs were intentionally skipped, and all 22 inline review threads are resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: bb4eea0d9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Synchronize the contribution branch with promptfoo/promptfoo main at 7d6b91a without rewriting its existing commits.

Copy link
Copy Markdown
Author

Hi maintainers — a quick follow-up on this PR. I’ve synced the branch with current main (7d6b91a6), and all checks on head 01b28ba0 are green (CI #50024: 27 passed, 2 intentional skips; PR title and Code Scan also passed). All review threads remain resolved, and the PR is conflict-free. When you have time, I’d appreciate a human review. Thank you!

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T02:57:32.275330Z 39cae0e New commits
🔒 Security Review ✅ Completed 2026-09-16T01:52:55.424449Z cc9a638 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@promptfoo-scanner promptfoo-scanner Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 All Clear

Reviewed changes focused on URL encoding and routing for eval/result identifiers across the web UI, API utilities, CLI, and server startup behavior. No LLM calls, prompts, or agent/tool capabilities were added or modified. The updates improve safety by consistently encoding IDs and validating CLI inputs. No LLM security vulnerabilities were identified.

Minimum severity threshold: 🟡 Medium | To re-scan after changes, comment @promptfoo-scanner
Learn more


Was this helpful?  👍 Yes  |  👎 No 

Copy link
Copy Markdown
Author

Hi @mldangelo — following up one week after the upstream sync on this contribution. The PR remains open, non-draft, mergeable, and currently contains the upstream base (26 commits ahead, 0 behind). On exact head cc9a638, CI, Validate PR Title, and Promptfoo Code Scan all passed; all 23 review threads are resolved and there are no outstanding change requests.

Could you let me know whether any code-owner concern remains, or whether this can be scheduled for merge? I’m happy to address a specific request promptly. Thanks.

Preserve encoded eval API paths alongside upstream API-base overrides and reconcile browser-launch regression coverage.

seva9523 commented Oct 4, 2026 •

Copy link
Copy Markdown
Author

Hi maintainers, following up on the review request from 23 September. I resolved the upstream API-helper conflict and updated the browser-launch regression on 30 September. All 23 review threads remain resolved.

I have now synchronized the branch with upstream main c4863c9; current head is 1dba579. Examples, Code Scan, title validation, and the dedicated Python example workflows all passed. CI run 37183366659 has 29 successful jobs and 2 conditional skips, with one failure in the installed-package Windows job: node.exe import-api.mjs exits with 3221225477 (0xC0000005) after logging the successful ESM root API fixture assertions. The same installed-package jobs passed on the upstream base; the artifact fixture is unchanged by this PR. This suggests a native/runtime crash, but a retry is needed to establish whether it is intermittent. My integration cannot re-run the failed job (HTTP 403). Could a maintainer re-run that job?

Could you also confirm whether a code-owner review or any specific change is still needed before merge? I can address a focused request promptly. Thank you.

Comment written by Codex.

chore: sync view-specific-eval with upstream main

seva9523 commented Oct 8, 2026

Copy link
Copy Markdown
Author

Hi maintainers, could someone re-run the single failed Windows installed-package job in CI run 37183366659 and review this PR? The run is still on attempt 1 at current head 1dba579; the ESM API assertions completed before Node exited with 0xC0000005. The integration still cannot re-run upstream Actions. GitHub reports the PR is conflict-free, although main has advanced since the last sync. I can update the branch or address a focused code-owner request if needed. Thank you.

Comment written by Codex.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@mldangelo mldangelo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All 67 checks pass on the refreshed head. Reviewed the ID-validation and URL-encoding changes across CLI, server, and browser routes. Real CLI checks cover normal IDs plus slashes, query/hash characters, Unicode, backslashes and literal percent characters, with rejected ambiguous IDs and verified export fallbacks. The built browser also loaded these evaluations, persisted manual ratings/name/author edits, opened result details and an embedded red-team report, and preserved the encoded evaluation ID through the report log link and copy workflow. Local validation includes 36,658 backend tests (10 skipped), 5,970 UI tests, current-main integration tests, TypeScript, architecture, Knip, style, and core/app/docs builds.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c3f613e29

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/view.ts
return;
}

await startServer(cmdObj.port, browserBehavior, `/eval/${encodeURIComponent(cmdObj.id)}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Serve direct eval URLs as HTML for script-suffixed IDs

When a stored ID ends in .js, .mjs, or .cjs—for example, an imported run.js—opening this URL reaches setJavaScriptMimeType in src/server/server.ts:72-75, which sets Content-Type: application/javascript. The SPA fallback at lines 365-371 then sends index.html without overriding that header, so the browser does not render the viewer, even though the eval can be selected through client-side navigation. Use the supported query-parameter route for the initial URL, or ensure the HTML fallback resets the MIME type.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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.

3 participants