Skip to content

feat(agent-config): agent config API client, configure permission and review helpers [9/21] - #330

Merged
gusfcarvalho merged 3 commits into
agent-config/08-overlay-draftfrom
agent-config/09-config-api
Oct 6, 2026
Merged

gusfcarvalho merged 3 commits into
agent-config/08-overlay-draftfrom
agent-config/09-config-api

Conversation

@gusfcarvalho

Copy link
Copy Markdown
Contributor

Part 9 of 21 of the stacked split of #318 (agent remote configuration). Every layer adds the final version of its files from #318, and only imports from layers below it, so each layer passes make reviewable on its own. Nothing is reachable in the app until layer 20 wires the Configuration tab in.

What

The agent-config API client (useAgentConfigApi) on the axios layer, a jsonBody request transform that sends overlay keys verbatim (no camel/kebab conversion), the agent:configure permission action, usePermissions().loaded, and the review-row helpers used by the workspace and save preview.

Tests

Specs for the API client and the axios transform.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:52
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 45a0b589-6f2b-475d-9386-b9809fa6c5c5
  • Autopilot · 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

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

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gusfcarvalho
gusfcarvalho force-pushed the agent-config/09-config-api branch from e479df4 to 5747965 Compare October 5, 2026 16:32
@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/09-config-api branch from 5747965 to 9607c2d Compare October 6, 2026 09:40
@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/09-config-api branch from 9607c2d to d7054a8 Compare October 6, 2026 11:38
ianmiell
ianmiell previously approved these changes Oct 6, 2026

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

ccf-review: APPROVE

no findings.

Stack (gh stack 343): #322 → #323 → #324 → #325 → #326 → #327 → #328 → #329 → #330 → #331 → #332 → #333 → #334 → #335 → #336 → #337 → #338 → #339 → #340 → #341 → #342

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ccf-review: would REQUEST_CHANGES

Submitted as COMMENT: GitHub does not let a PR's author request changes on or approve it.

1 Must-fix.

Stack (gh stack 343): #322 → #323 → #324 → #325 → #326 → #327 → #328 → #329 → #330 → #331 → #332 → #333 → #334 → #335 → #336 → #337 → #338 → #339 → #340 → #341 → #342

);
return saveResult(res);
}),
listInstances: (agentId) =>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Must-fix] Follow the API's bounded instance list (companion of api#476)

Reviewer decision on compliance-framework/api#476: the instance list is paginated before merge. GET /api/admin/agents/{id}/instances today returns every instance with its full summary columns (warnings, unsafe, plugins, remote-config). That can exceed 1 GiB for one agent, and listInstances loads it in full whenever an agent is opened.

New API contract (being implemented on api#476/#483):

  • query page (default 1) and limit (default 25, max 25); data holds that page's instance summaries, same order as today (last seen first);
  • meta: desired-revision, counts (still over all instances: total, fresh, stale, in-sync, out-of-sync, pending, rejected, failed, unknown), plus page, limit, total, total-pages;
  • GET …/instances/{instanceId} is unchanged.

Why: The API change breaks this client's assumption that the list carries full per-instance lists; landing one side without the other breaks the Configuration tab.
Fix: What the UI needs to do (this PR and the ones above it in the stack):

  1. feat(agent-config): agent config API client, configure permission and review helpers [9/21] #330 useAgentConfigApi.ts: listInstances(agentId, { page, limit }) sends the query and returns { items, meta } with the new meta fields. Update InstancesMeta/InstancesList in api-types.ts and the useAgentConfigApi.spec.ts cases (query params, meta shape).
  2. Fleet-wide numbers come from meta.counts, not from the loaded rows: summarizeSync and the instance count (useAgentConfig.ts, AgentConfigTab.vue instance-count).
  3. Code that needs every instance: field access (field-access.ts, which uses each instance's remoteConfig and plugins), the warnings aggregation in useConfigWorkspace.ts, and the save-preview instance list. Load all pages through one helper (for example listAllInstances: sequential pages until page === total-pages) with a hard cap on pages. Past the cap, show that the view covers only part of the fleet; do not silently compute over a partial set.
  4. The instance picker (AgentConfigTab.vue, v-if="state.instances.value.length > 1") pages through the list instead of rendering every row.
  5. Update fixtures, the integration specs (test(agents): integration specs for the Configuration tab [21/21] #342) and the conformance or field-access tests that build instance lists.
    Merge only together with api#476/#483; landing either side alone breaks the Configuration tab.
    Severity basis: no rule matched; decision tree: wrong behaviour or missing companion change.

ccf-review · 4142df644d96 · rules@992d25d050e9

@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/09-config-api branch from fb9f246 to b1748b6 Compare October 6, 2026 14:20
gusfcarvalho and others added 3 commits October 6, 2026 11:24
… review helpers

Layer 9 of 21 in the stacked split of #318.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- listInstances sends ?page&limit (default 1 and 25, the API's max) and
  returns one page with its meta (page, limit, total, totalPages and the
  fleet-wide counts)
- listAllInstances (instancePages.ts) is the one way to load every
  instance: pages in order until the last one, at most
  MAX_INSTANCE_PAGES (4 pages = 100 instances; a worst-case summary is
  about 3 MiB), each instance once. Past the cap, or when the list moved
  while paging, the result is marked partial

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hen it moved

listAllInstances marks the result partial when it stops at the page
cap, or when a row comes back twice (the list moved under the pages, so
another row was skipped), instead of comparing the rows with
counts.total.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/09-config-api branch from b1748b6 to 17842c8 Compare October 6, 2026 14:38
@gusfcarvalho
gusfcarvalho merged commit 0b7bfc0 into main Oct 6, 2026
7 checks passed
@gusfcarvalho
gusfcarvalho deleted the agent-config/09-config-api branch October 6, 2026 15:14
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.

3 participants