Skip to content

test: FME dual-mode prompt coverage and empty workspace_id scope fix - #822

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-b7b6
Draft

test: FME dual-mode prompt coverage and empty workspace_id scope fix#822
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-b7b6

Conversation

@cursor

@cursor cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

Triggered by PR #820 (version bump). Inspected recent merged FME dual-mode work (#806) and found meaningful regression gaps.

Risky behavior now covered

  • feature-flag-rollout prompt — dual-mode scope validation (legacy workspaceId vs Harness-native orgId+projectId), partial-scope rejection, and Harness-native NYI caveat text that steers agents away from unsupported steps.
  • FME scope injection — empty-string workspace_id in filters no longer suppresses Harness-native organization_identifier/project_identifier query params (registry aligned with applyUrlDefaults).
  • List scope guard — whitespace-only org_id/project_id values are treated as unresolved project scope.
  • harness_list tool path — end-to-end check that URL-derived org/project reach the FME v4 list API when filters carry a cleared workspace_id.

Test files added/updated

  • tests/prompts/feature-flag-rollout.test.ts (new)
  • tests/registry/feature-flags.test.ts
  • tests/registry/list-filter-utils.test.ts
  • tests/tools/tool-handlers.test.ts

Production fix

  • src/registry/index.ts — treat empty-string workspace_id as absent when deciding whether to suppress Harness-native scope params.

Why these tests materially reduce regression risk

The FME dual-mode migration is high blast-radius: agents can pass mutually exclusive scope selectors (workspace_id vs org_id+project_id) through prompts, filters, and URL defaults. Without these tests, a stray empty workspace_id filter could silently drop scope params and produce 4xx/empty results against the Harness-native v4 API — the exact class of bug fixed in #806 for applyUrlDefaults but missed in registry dispatch.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Checklist

  • pnpm test passes (targeted: prompt, feature-flags, list-filter-utils, tool-handlers — 282 tests)
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm standards:check passes
  • pnpm docs:check passes (registry/tool counts unchanged)
Open in Web View Automation 

…ce_id suppression

Add regression tests for the feature-flag-rollout prompt’s Harness-native
vs legacy scope validation, list-filter whitespace handling, and harness_list
URL merge when filters carry an empty workspace_id.

Fix registry scope injection to treat empty-string workspace_id as absent,
matching applyUrlDefaults — prevents Harness-native org/project params from
being dropped when agents pass a cleared workspace_id filter.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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