Skip to content

fix(frontend): fix the endpoints snippet, prompts type, variants labels and the traces filter warning in /m - #8076

Merged
mmabrouk merged 9 commits into
release/v0.128.7from
fix/m-hidden-views-preview
Nov 4, 2026
Merged

mmabrouk merged 9 commits into
release/v0.128.7from
fix/m-hidden-views-preview

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Small fixes to hidden /m views. Safe for v0.128.5 if the release session wants them; otherwise the next release.

Context

A live QA run on the hidden /m developer views (endpoints, prompts, variants and the observability app filter) found bugs that block showing these views to users. Each fix below is its own commit with a test that failed before the fix. The QA also found that a prompt moved into a folder cannot be moved back to the top level. That fix needs an API change, so it is in #8077 for the next release, and the /m Move dialog still offers folders only.

Changes

Endpoints: the code snippet sent empty inputs. The snippet read the revision's input schema, and a prompt app usually has none, so a copied call failed with HTTP 400 "Expected ['country']". The snippet now reads the revision's input ports, as /w does, so each prompt variable gets a placeholder. It works for completion and chat apps, and odd variable names stay quoted in Python, cURL and TypeScript.

Before: "inputs": {}. After: "inputs": {"country": "add_a_value"}.

Prompts: a chat app showed "Completion". The list read the type from the app list flags, which carry no chat flag. The row now reads the type from the latest revision, the same source /w uses.

Variants: labels and Modified by.

  • An empty deploy note now stays empty, as in /w. /m sent no note, and the shared package then wrote Deploy <app>.revision as the note.
  • The revision drawer title is "Revision" (it said "Workflow Revision"), and the delete toast says "Deleted revision successfully".
  • Modified by now shows the user. /m never binds the shared user lookup that UserAuthorLabel needs, so every id showed a dash. The Deployments tab now passes the names from the workspace members (username, else email). Other /m tables with Created by still show a dash; binding the lookup app wide would add a members request to every page, so it is left for a follow-up.

Observability: React logged "Cannot update a component while rendering a different component". The screen wrote the app scope atoms during its render, and the mounted TracesFilters read them, so React logged an error on the first filter change. The picker now writes the scope in its change handler, so the render after the URL change has nothing to write. The write during the first render stays, because it scopes the first traces request before any reader mounts.

Shared package changes

  • @agenta/settings-ui: buildAppEndpointParams takes inputs (the input ports) instead of inputSchema. Only /m and its Storybook story call it. /w does not use it.
  • @agenta/entity-ui: the revision drawer title. Only /m renders that drawer.

The /w type check passes, and nothing changes for /w.

Tests

  • New and updated tests: endpoints screen and snippet builder, prompts screen type, deploy note (real publish mutation, only the HTTP client mocked, asserting the commit body), deployments tab, revision drawer, and the app scope warning.
  • /m and /w type checks pass. The full /m suite passes except membersTabRoleChange, which fails on the release branch too. The entities, entity-ui and settings-ui suites pass except mcp-policy-ladder, which fails only on a copy without .git.
  • speed:check passes. Every shared page has the same first-load size as the base. The variants view grew by 0.1 KB.
  • One review round (slop, simplify, correctness) rated every lens Low. A final correctness pass found nothing. After that pass, the move commit was taken out, and nothing else changed.

What to QA

Turn on the developer views endpoints, prompts, variants and observability-app-filter.

  • Endpoints: deploy a completion app that uses {{country}}, open its environment, copy the Python snippet and run it with a real key. The call succeeds.
  • Prompts: a chat app shows Chat, and a completion app shows Completion.
  • Variants: deploy with an empty note. The Notes column shows a dash. Modified by shows your user. Open a revision: the drawer title is Revision.
  • Observability: change the app filter on the Traces tab. The browser console shows no React error.
  • Regression: on the /m variants Deployments tab, deploy with a written note. The note shows as written.

Agenta Product Agent added 2 commits November 3, 2026 23:58
…ables in /m

The snippet read the revision's input schema, which a prompt app often leaves
empty, so it sent "inputs": {} and a copied call failed with HTTP 400. Read the
input ports instead, as /w does, so each prompt variable gets add_a_value.
The list read the type from the app list flags, which carry no chat flag, so
every prompt showed Completion. Read the latest revision's type, as /w does.
@mmabrouk

mmabrouk commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head f8fbe2f2cc (base d6ef7781e5), one round plus a final correctness pass.

Lens Final rating
Slop (Opus and Codex) Low
Simplify (Opus and Codex) Low
Correctness (Codex, round 1 and final head) Low

Fixed: the Endpoints story still passed inputSchema, so it threw on load. The params builder used inputs for two things.
Left on purpose: the PromptItem alias stays, because the dialog state types name it. The two-line folder_id guard stays in both the application and evaluator services, so the services stay independent.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Generated endpoint snippets now include prompt variables with editable placeholders, including for chat apps.
    • Deployment history displays authors’ workspace usernames or email addresses when available.
  • Bug Fixes
    • Selecting an app in observability keeps the selected app scope in sync with the URL.
    • Prompt rows show the correct workflow type.
    • Deployment notes are trimmed before saving, including empty notes.
  • Updates
    • Revision deletion confirmations and revision drawer titles now use clearer wording.

The PR updates endpoint snippet inputs, observability app selection, prompt type display, and variant deployment and revision behavior. It also changes revision labels and notifications, and updates tests and Storybook examples for these changes.

Changes: Endpoint snippet inputs

Layer / File(s) Summary
Input contract and snippet generation
web/packages/agenta-settings-ui/src/publish/snippets/appEndpoint.ts, web/packages/agenta-settings-ui/tests/unit/appEndpointSnippets.test.ts
The snippet builder accepts keyed inputs with optional schemas. It uses schema defaults or an add_a_value placeholder. Tests cover chat inputs, defaults, and input-name formatting.
Revision input wiring and validation
web/mobile/src/features/endpoints/useEndpointSnippets.ts, web/mobile/tests/unit/endpointsScreen*, web/storybook/stories/developer-views/EndpointsScreen.stories.tsx
The endpoint hook and Storybook example pass input ports to the builder. Mobile tests cover generated completion and chat snippets.

Observability app selection

Layer / File(s) Summary
App selection and URL update
web/mobile/src/features/observability/observabilityAppScope.ts, web/mobile/src/features/observability/ObservabilityScreen.tsx, web/mobile/tests/unit/observabilityAppScope.test.tsx
The new useSelectObservabilityApp hook updates the selected app scope before updating the URL. The screen uses the hook, and the test checks the scope and shallow URL update.

Prompt type display

Layer / File(s) Summary
Workflow type source and row display
web/mobile/src/features/prompts/*, web/mobile/tests/unit/promptsScreen.render.test.tsx, web/mobile/tests/unit/promptsTestStore.tsx
Prompt records no longer receive a derived type field. Prompt rows read the type from the workflow type atom. Tests seed latest-revision data and check the displayed labels.

Variant deployment and revision updates

Layer / File(s) Summary
Workspace member lookup and history labels
web/mobile/src/features/variants/DeploymentsTab.tsx, web/mobile/src/features/variants/DeploymentHistoryTable.tsx, web/mobile/src/features/variants/VariantsScreen.tsx, web/mobile/tests/unit/deploymentsTab.render.test.tsx, web/storybook/stories/developer-views/DeploymentsTab.stories.tsx
The deployments tab builds an author-name map from workspace members and passes it to the history table. Tests cover username, email, and unknown-author labels.
Trimmed note serialization and tests
web/mobile/src/features/variants/useDeploymentWrites.ts, web/mobile/tests/unit/variantsDeployNote.test.tsx
The deployment write payload retains an empty string after trimming a blank note. Tests cover empty and non-empty deploy and revert notes.
Revision title and deletion notification
web/mobile/src/features/variants/DeleteRevisionDialog.tsx, web/packages/agenta-entity-ui/src/variant/RevisionDrawer/RevisionDrawerHeader.tsx, web/mobile/tests/unit/variantDialogs.render.test.tsx, web/packages/agenta-entity-ui/tests/unit/revisionDrawer.render.test.tsx, web/storybook/stories/entity-ui/RevisionDrawer.stories.tsx
The revision drawer title changes to “Revision.” The successful deletion message changes to “Deleted revision successfully.” Tests and the Storybook interaction use the updated text.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Merge Risk: Low · up to ad3d1

Some deployment author names and prompt type indicators may remain unavailable after recoverable lookup failures, but safe fallback UI remains and the affected workflows can continue.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description clearly covers the endpoints, prompts, variants, and observability changes in the pull request, including testing and QA details.
Title check Passed The title accurately summarizes the main fixes for endpoints snippets, prompt types, variants labels, and the observability filter warning in /m.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 28 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7f1a2c7 and ad3d1d8.

Files selected for processing: 1
  • web/storybook/stories/developer-views/DeploymentsTab.stories.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

Agenta Product Agent added 3 commits November 4, 2026 00:29
- An empty deploy note now stays empty, as in /w. /m sent undefined, and the
  package then wrote the raw "Deploy <app>.revision" key as the note.
- The revision drawer title is Revision, and the delete toast says revision.
- Modified by shows the member name. /m never binds the shared user atoms, so
  the author label could not resolve an id; the tab now passes the names from
  the workspace members.
…traces app filter

The screen wrote the app scope atoms during its render. With the traces filters
already mounted, that write updated TracesFilters while ObservabilityScreen
rendered, and React logged an error. A pick in the toolbar now writes the scope
in the change handler, so the render after the URL change has nothing to write.
The story still passed inputSchema, so the module threw on load. Also rename the
builder's local map, so inputs means one thing there.
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Website preview

Preview URL: https://pr-8076-agenta-website-preview.mahmoud-637.workers.dev

Built from ad3d1d84a0f3449ba387f5d89c7483074ae4ef34. This comment updates in place on every push.

@mmabrouk
mmabrouk force-pushed the fix/m-hidden-views-preview branch from f8fbe2f to a931cd1 Compare November 3, 2026 23:30
@mmabrouk mmabrouk changed the title fix(frontend): fix the endpoints snippet, prompts type and move, variants labels and the traces filter warning in /m fix(frontend): fix the endpoints snippet, prompts type, variants labels and the traces filter warning in /m Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Item Value
Status stopped
Commit ad3d1d84a0f3449ba387f5d89c7483074ae4ef34
Manual expiry (UTC) Not granted
CI deadline (UTC) Not granted
Workflow https://github.com/Agenta-AI/agenta/actions/runs/41910620383

PR closed or converted to draft. Environment absence verified; retained storage requires separate provider accounting.

Post /preview as a new comment to request a one-hour preview. Repeating it while active does not extend the hour.
Preview data is disposable. Expiry is enforced by the next successful cleanup sweep, not an exact timer.
Environment deletion stops its compute. Provider-retained storage and permanent services may still be billed.

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

Actionable comments posted: 3

Nitpick comments: 1
web/mobile/tests/unit/variantsDeployNote.test.tsx: 1

2-5: Trivial · Maintainability & Code Quality · Quick win

Reduce the test header comment to one line.

Repository rules for web/** allow at most one short line per in-code comment. Multi-line prose that describes test setup is not an exception. Keep the mocking distinction in one line.

Proposed edit
-/**
- * The deploy and revert writes over the real publish mutation. Only the HTTP client is replaced,
- * so each test checks the environment commit body that would reach the server.
- */
+// Exercise the real publish mutation; mock only HTTP.
Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d6ef778 and a931cd1.

Files selected for processing: 24
  • web/mobile/src/features/endpoints/useEndpointSnippets.ts
  • web/mobile/src/features/observability/ObservabilityScreen.tsx
  • web/mobile/src/features/observability/observabilityAppScope.ts
  • web/mobile/src/features/prompts/PromptRowCells.tsx
  • web/mobile/src/features/prompts/promptRow.ts
  • web/mobile/src/features/prompts/usePromptsBrowser.ts
  • web/mobile/src/features/variants/DeleteRevisionDialog.tsx
  • web/mobile/src/features/variants/DeploymentHistoryTable.tsx
  • web/mobile/src/features/variants/DeploymentsTab.tsx
  • web/mobile/src/features/variants/VariantsScreen.tsx
  • web/mobile/src/features/variants/useDeploymentWrites.ts
  • web/mobile/tests/unit/deploymentsTab.render.test.tsx
  • web/mobile/tests/unit/endpointsScreen.render.test.tsx
  • web/mobile/tests/unit/endpointsScreenFixtures.ts
  • web/mobile/tests/unit/observabilityAppScope.test.tsx
  • web/mobile/tests/unit/promptsScreen.render.test.tsx
  • web/mobile/tests/unit/promptsTestStore.tsx
  • web/mobile/tests/unit/variantDialogs.render.test.tsx
  • web/mobile/tests/unit/variantsDeployNote.test.tsx
  • web/packages/agenta-entity-ui/src/variant/RevisionDrawer/RevisionDrawerHeader.tsx
  • web/packages/agenta-entity-ui/tests/unit/revisionDrawer.render.test.tsx
  • web/packages/agenta-settings-ui/src/publish/snippets/appEndpoint.ts
  • web/packages/agenta-settings-ui/tests/unit/appEndpointSnippets.test.ts
  • web/storybook/stories/developer-views/EndpointsScreen.stories.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Agenta Product Agent added 3 commits November 4, 2026 12:29
…den-views-preview

# Conflicts:
#	web/mobile/src/features/observability/ObservabilityScreen.tsx
#	web/mobile/src/features/variants/DeleteRevisionDialog.tsx
#	web/mobile/src/features/variants/DeploymentsTab.tsx
The release branch brought in three test files that fail the mobile lint on
import/order. Sort the imports so the lint has no errors.
@mmabrouk

mmabrouk commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: Live QA passed on head 7f1a2c7 (release/v0.128.5 merged in, no conflicts).

Setup: one fresh OSS dev stack built from release/v0.128.5 with #8075, #8076, #8077 and #8086 merged in, developer views playground,prompts,variants,endpoints,observability-app-filter on, a new account, Chromium at 1440 px and 390 px. The API ran this batch's code.

  • Endpoints: I copied the production Python and cURL snippets. They send "country": "add_a_value". With an API key and a real value, both calls returned HTTP 200 ("Paris", "Tokyo"). Pass at 1440 and 390.
  • Prompts: qa-chat shows Chat and qa-completion shows Completion. Pass at 1440 and 390.
  • Variants: a deploy with an empty note sends message: "", and the Notes column shows a dash. A deploy with a note shows the note as written. Modified by shows the user. The revision drawer title is "Revision".
  • Observability: the first and second app filter changes log no "Cannot update a component" error. The filter stays after a reload. Pass at 1440 and 390.

Checks on this head: /m types, /w types, pnpm run lint in web/mobile (0 errors), the PR's tests (mobile 87, entity-ui, settings-ui), and speed:check after a fresh next build all pass. Needed CI is green. Only the web test jobs fail, and they do not gate.

The screen recording (MP4) is saved with the QA evidence. I could not attach it here because the browser upload was not available in this session.

@mmabrouk
mmabrouk merged commit ba8f446 into release/v0.128.7 Nov 4, 2026
61 of 63 checks passed
@mmabrouk mmabrouk mentioned this pull request Nov 4, 2026
7 tasks done
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.

1 participant