Skip to content

[codex] Fix image target id parsing#2722

Draft
sedghi wants to merge 1 commit into
mainfrom
codex/fix-target-id-parsing
Draft

[codex] Fix image target id parsing#2722
sedghi wants to merge 1 commit into
mainfrom
codex/fix-target-id-parsing

Conversation

@sedghi

@sedghi sedghi commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

Fix delimiter-unsafe parsing of stack image target IDs. Target IDs use the imageId:<imageId> format, but several call sites used split('imageId:')[1], which truncates valid image IDs when the underlying URL or query string also contains imageId:.

This change adds a shared BaseTool helper that removes only the fixed prefix with slice, updates the runtime call sites that parsed image target IDs, and adds regression coverage for an image ID containing the delimiter.

Impact

Valid stack image IDs containing the literal imageId: are preserved for cached stats, probe index calculation, magnification, and rectangle ROI threshold annotations. This avoids incorrect viewport/image lookup and stale or missing measurement recalculation for otherwise valid images.

Validation

  • Confirmed no remaining split('imageId:') call sites under packages/tools/src or packages/core/src.
  • Could not run the Jest test suite in this local environment because the repo has no root node_modules, yarn/npm/npx are not on PATH, and the pre-commit hook also depends on yarn.
  • Attempted Prettier through a temporary npm bootstrap; repo-configured Prettier could not load @prettier/plugin-oxc without the repo dependency tree installed.

@sedghi sedghi requested a review from jbocce May 5, 2026 15:00

@jbocce jbocce 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.

The code changes look fine. However, the PR is still in draft and there are code conflicts and failing checks.

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