Skip to content

[AGE-4014] fix(frontend): Show changed-path affordance for provider/connection edits in config drawer - #5627

Closed
bekossy wants to merge 6 commits into
release/v0.112.2from
AGE-4014-/-config-drawer-provider-level-change-shows-a-dirty-badge-but-no-changed
Closed

[AGE-4014] fix(frontend): Show changed-path affordance for provider/connection edits in config drawer#5627
bekossy wants to merge 6 commits into
release/v0.112.2from
AGE-4014-/-config-drawer-provider-level-change-shows-a-dirty-badge-but-no-changed

Conversation

@bekossy

@bekossy bekossy commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #5544. In the agent config's Model & harness section, changing the provider/connection without committing shows the "Draft" state and the "Connect key" badge on the collapsed header, but expanding it showed no changed-path affordance at all — no dotted underline, no committed-value popover, no Restore.

Root cause: that section has three inline render branches, in precedence order — needs-key pane, changed-diff view, plain drawer row. When a provider/connection key is missing, the needs-key pane always wins, and it renders the bare ProviderCredentialsSection variant, which is headerless by design and is never mounted under a ChangedPathsProvider. So even when a real diff exists, the component reading it silently sees "nothing changed."

Changes

When the needs-key pane is showing AND the edit that triggered it touched llm.connection.*/llm.provider specifically (not some other model-harness field like harness.kind), it now renders through the same ChangedPathsProvider-wrapped path the rest of the panel's diff views use, and swaps to the non-bare ProviderCredentialsSection — the variant that already has the "Connect key" badge, a changed-path indicator dot, and a "Revert this group?" action, just previously never assembled together for this specific pane.

A change to an unrelated model-harness field keeps the original plain pane (with the inline model picker) unchanged — this only widens the branch that was structurally incapable of showing a diff.

Testing

Verified locally

  • tsc --noEmit clean on @agenta/entity-ui and on web/oss (which consumes this component).
  • eslint clean on both touched files.

Added or updated tests

N/A — no existing unit tests cover AgentTemplateControl/useModelHarness/ProviderCredentialsSection.

QA follow-up

  • Open an agent's config, Model & harness section. Switch the connection/provider mode without committing. Expanding the section should now show the "Connect key" badge alongside a changed indicator and a group Restore action, not a plain unmarked form.
  • Regression: change something else in the same section (e.g. harness kind) while a key is also missing — the pane should still show the plain connect-key form with the inline model picker, unchanged from before.

Demo

Screen.Recording.2026-08-01.at.4.06.36.PM.mov

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

@linear-code

linear-code Bot commented Aug 1, 2026

Copy link
Copy Markdown

AGE-4014

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 1, 2026
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 17, 2026 11:21am

Request Review

@dosubot dosubot Bot added the frontend label Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 66e14d61-6f76-4dda-8314-b73089f72c8f

📥 Commits

Reviewing files that changed from the base of the PR and between 8013d4a and 2c05d0a.

📒 Files selected for processing (1)
  • web/oss/src/components/Playground/Playground.tsx
💤 Files with no reviewable changes (1)
  • web/oss/src/components/Playground/Playground.tsx

Included review availability: Your plan includes up to 8 reviews per rolling hour; 6 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Applied a minor internal cleanup with no observable changes to the product experience.

Walkthrough

The provided diff contains no observable functional, declaration, or behavior change in Playground.tsx.

Changes

Playground diff

Layer / File(s) Summary
No observable change
web/oss/src/components/Playground/Playground.tsx
The provided hunk contains no observable code change.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 2c05d

This localized frontend change restores the changed-path affordance for provider and connection edits without evidence of broader product impact; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The provided diff shows no observable functional changes, so it does not demonstrate the linked issue's required changed-path behavior. Provide the functional implementation that renders the diff-aware provider and connection view, and include evidence that the linked behavior is fixed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the intended frontend fix for changed-path affordances on provider and connection edits.
Description check ✅ Passed The description directly explains the provider and connection affordance issue, the intended fix, and regression behavior.
Out of Scope Changes check ✅ Passed The summary identifies no unrelated files or changes outside the frontend configuration-drawer objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch AGE-4014-/-config-drawer-provider-level-change-shows-a-dirty-badge-but-no-changed

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

Comment @coderabbitai help to get the list of available commands.

@bekossy
bekossy changed the base branch from release/v0.106.2 to main August 1, 2026 14:05

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 09d42cc0-b2ea-4d3d-93b2-12d171e0b640

📥 Commits

Reviewing files that changed from the base of the PR and between 7c395db and 14754a8.

📒 Files selected for processing (2)
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsx
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx

@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: f601b57be6

ℹ️ 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".

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-5627.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-5627-dd110a3
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-08-17T11:29:18.618Z

@bekossy
bekossy marked this pull request as draft August 1, 2026 15:58
@bekossy
bekossy marked this pull request as ready for review August 1, 2026 16:08

@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: 14754a8b0e

ℹ️ 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".

… atomically, trim comment

Addresses review: a provider-only change (llm.provider without llm.connection) now gets the
same changed indicator and Restore as a connection change. The group Restore also reverts
llm.model alongside provider/connection, since writeModel can move all three together and a
partial revert reattaches a stale connection slug to the new model (rejected by the backend).
Also trims a comment that grew past the one-line convention.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
# Conflicts:
#	web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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

Read the diff plus ChangedPathsContext, FocusPathsContext, sectionChanges.ts and ProviderCredentialsSectionView. Three things — the first one blocks.

// `writeModel` can move `llm.model` atomically with `llm.provider`/`llm.connection.slug` (a
// catalog pick clears the old custom slug) — revert all three together or the group's Restore
// reattaches a stale slug to the new model, a combination the backend rejects.
const revertCredentials = useCallback(() => {

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.

This restores only llm.model.

Each of revertConnection / revertProviderField / revertModel is onChange(revertPathsTo(config, committed, paths)) (AgentTemplateControl.tsx:497), closed over the same render-time config. Calling them in sequence is three full-config writes in one handler — last write wins, so the reverted provider and connection slug are overwritten by the model-only revert. That leaves the new provider/slug with the old model: the exact combination the comment above says the backend rejects.

Needs to be one revert() call with the union of paths, e.g. a multi-prefix useRevertUnder, or revert([...pathsUnder("llm.connection"), "llm.provider", "llm.model"]).

revertPermissions a few lines up has the same shape and the same latent bug.

disabled={disabled}
>
{mh.providerCredentialsInline}
{credentialsPathChanged ? (

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.

This drops the inline model picker from the connect-key pane.

providerCredentialsSection is the non-bare variant: it never receives modelControl, and it renders railDetail rather than topRail (ProviderCredentialsSectionView.tsx:612-653). So this branch loses the model select and swaps in the 190px side rail that the comment on topRail describes as leaving the key form cramped in a narrow column.

That hits the common path, not an edge case: the usual way into the needs-key state is a catalog model pick, which moves llm.provider, so credentialsPathChanged is true. Threading bare + modelControl into the changed-aware render would keep the picker and the compact rail alongside the new badge/indicator/revert.

// catalog model switch can move on its own — track both, or a provider-only change gets a "Connect
// key" badge with no changed indicator or Restore to go with it.
const connectionChanged = useHasChangedUnder("llm.connection")
const providerFieldChanged = useHasChangedUnder("llm.provider")

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.

credentialsInFocus (line 468) wasn't widened along with credentialsChanged — it still checks llm.connection only.

In the non-key "what changed" branch, a provider-only diff therefore leaves harnessKindInFocus, modelInFocus and credentialsInFocus all false, and the expanded section renders nothing but the "Detailed configuration" link. That's the #5544 symptom again, in the branch this PR doesn't touch — and it's the same provider-moves-on-its-own case the comment right here describes.

@bekossy
bekossy changed the base branch from main to release/v0.112.2 August 17, 2026 10:35
…/-config-drawer-provider-level-change-shows-a-dirty-badge-but-no-changed

# Conflicts:
#	web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/AgentTemplateControl.tsx
#	web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/useModelHarness.tsx
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 17, 2026
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@bekossy

bekossy commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

Superseded by an upstream Model & harness section redesign (connection-first model picker) that already resolves this — the section is now always rendered inline with a change indicator covering the full llm object, so a provider/connection-only edit can no longer show a dirty badge with no visible diff. Will ship in release v0.112.2. Closing in favor of that fix.

@bekossy bekossy closed this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[config-drawer] Provider-level change shows a dirty badge but no changed-path underline/popover/Restore; section expands to the full edit form

2 participants