Skip to content

feat: approval agent config resolution and provider improvements#975

Merged
larryro merged 8 commits into
mainfrom
feat/approval-agent-config-and-provider-improvements
Apr 5, 2026
Merged

feat: approval agent config resolution and provider improvements#975
larryro merged 8 commits into
mainfrom
feat/approval-agent-config-and-provider-improvements

Conversation

@larryro
Copy link
Copy Markdown
Collaborator

@larryro larryro commented Apr 5, 2026

Summary

  • Approval cards (human input, location) now resolve agent config from thread metadata instead of using hardcoded defaults, ensuring AI responses use the correct agent and model
  • Fix auth bypass in approval submission actions — internal mutations lost auth context, and actions lacked org membership verification
  • Make model selection editable on agent instructions page with interactive multi-select scoped to the agent's provider
  • Add claude-opus-4.6 and gpt-5.2 to supported models, update provider config schema and UI
  • Default integrations page to Connected tab and prevent access-denied flash while abilities load

Test plan

  • Submit a human input approval card and verify it uses the thread's agent config (not default)
  • Submit a location request approval and verify same behavior
  • Confirm approval submissions fail for users outside the org (auth check)
  • Edit supported models on agent instructions page — add/remove models and save
  • Open integrations settings page and confirm it loads on Connected tab without flash
  • Open provider settings page and verify edit/save flow works

Summary by CodeRabbit

Release Notes

  • New Features

    • Expanded AI model availability: added support for Anthropic Claude Opus 4.6 and OpenAI GPT-5.2.
    • Dynamic model selection interface in agent configuration with searchable model discovery.
    • Provider-level default model management by capability (chat, vision, embedding).
  • Improvements

    • Optimized integrations settings with reordered tabs and improved loading states.
    • Enhanced approval submission with better error handling and context resolution.
    • Improved component performance through better memoization and organization context threading.

larryro added 7 commits April 5, 2026 19:01
…provider settings

Approval cards (human input and location requests) now resolve the
agent config from the thread's metadata instead of using a hardcoded
default. This ensures AI responses use the user's selected agent and
model override. Follows the action-wrapper pattern from unified_chat.

Also improves provider configuration UI and schema validation.
…nfig in approval tools

Use proper type for agent config in human_input and location tools, removing
unsafe type assertions and fixing non-null assertion in query narrowing.
Replace the static read-only model list with an interactive multi-select
that lets users add and remove supported models from available providers,
scoped to the agent's configured provider when set.
Update OpenRouter provider secrets with rotated encryption.
…s denied flash

Show skeleton while abilities load so the access denied check doesn't
flash before permissions are resolved. Default tab changed to "connected"
and tab order swapped to match priority.
…tions

The internal mutations called from actions used ctx.auth.getUserIdentity()
which returns null in Convex internalMutation context, causing all approval
submissions to fail. Additionally, the action layer lacked organization
membership verification, allowing cross-org authorization bypass.

- Pass respondedBy/approvedBy as explicit args from action to mutation
- Add verifyOrganizationMembership check in both approval actions
- Remove deprecated public mutations (dead code per AGENTS.md)
- Deduplicate getApprovalContext query into approvals/internal_queries
- Extract shared DEFAULT_AGENT_CONFIG and return validator
- Add console.warn logging to catch blocks (no-empty-catch rule)
- Memoize modelId in approval card components
- Fix fragile JSON.stringify isDirty check with explicit field comparison
- Remove 6 unused i18n keys from en.json
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Stack component only accepts integer gap values (0-12). Change 0.5 to 1
to fix TS2322 type error caught by CI.
@larryro larryro merged commit 03c760a into main Apr 5, 2026
15 checks passed
@larryro larryro deleted the feat/approval-agent-config-and-provider-improvements branch April 5, 2026 13:11
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 5, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR refactors default model selection from per-model default: boolean flags to a provider-level defaults map associating capability tags (chat, vision, embedding) to model IDs. It includes schema updates with migration logic to convert legacy defaults, changes to provider loading and model resolution logic, and extends approval submission workflows to include model ID tracking and agent config resolution. The frontend is updated with dynamic model management UI, new Convex actions for approval submissions with authentication, and additional context passing for organizationId.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: approval agent config resolution and provider improvements are the core objectives evident throughout the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/approval-agent-config-and-provider-improvements

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

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