Skip to content

Remove consumed credits from Payables Agent setup - #10238

Open
Explorer986 wants to merge 1 commit into
mainfrom
private/kumarjatin/646660
Open

Remove consumed credits from Payables Agent setup#10238
Explorer986 wants to merge 1 commit into
mainfrom
private/kumarjatin/646660

Conversation

@Explorer986

@Explorer986 Explorer986 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What & why

Removed the consumed Copilot credits section from the Payables Agent setup page. This information will no longer be available as part of the upcoming monetization changes, so the related UI and unused calculation code have been removed.

Fixes AB#646660

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Built the Payables Agent app locally and published on BC local server and verified it behaves as expected.
  • Confirmed there are no remaining references to the removed cost estimate codeunit or consumed-credit controls.

Risk & compatibility

Low risk. The deleted codeunit was internal and used only by the removed setup-page controls.

@Explorer986
Explorer986 requested a review from a team August 13, 2026 15:59
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Finance GitHub request for Finance area labels Aug 13, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 13, 2026
Comment thread src/Apps/W1/PayablesAgent/app/Setup/PayablesAgentSetup.Page.al
@Explorer986
Explorer986 force-pushed the private/kumarjatin/646660 branch from 4cb4ae6 to 7816510 Compare August 14, 2026 10:09
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Request Changes

What this PR does

This PR removes the Cost section from the Payables Agent Setup page and deletes the internal codeunit that calculated consumed Copilot credits. The change matches the Slice goal to stop showing consumed-credit totals while leaving the trial and general billing text in place. The functional scope is narrow, but the page controls are removed outright instead of going through the obsolete path.

Suggestions

S1 - Obsolete shipped setup controls before removal
The diff deletes CostEstimateGroup, CostEstimateValue, and LearnMoreCost from a shipped setup page. Keep shipped page controls through the obsolete and clean-tag cycle before final removal. This avoids breaking upgrades, page customizations, and any consumers that still reference the controls.

Risk assessment and necessity

Risk: The business logic risk is low because the removed code only reads consumption data for display. The compatibility risk is higher because named controls on Payables Agent Setup disappear without an obsolete period. The deleted codeunit is internal, and no BaseApp event dependency was involved.

Necessity: The change is needed for the new monetization model, and the ADO Slice discussion supports removing only the consumed-credit total and Cost section. The scope is right once the shipped UI controls follow the normal obsolete and clean-tag path.


[AI-PR-REVIEW] version=1 promptVersion=2 system=github pr=10238 round=1 by=alexei-dobriansky at=2026-08-14T10:09:00.358Z lastSha=4cb4ae6fc66505860963e070be1ebbe4b8b3d7be reviewKey=na suggestions=S1@d9c4a300

Comment thread src/Apps/W1/PayablesAgent/app/Billling/PACostEstimate.Codeunit.al Outdated
@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟠\ High\ Severity\ —\ Upgrade}$

The entire PA Cost Estimate codeunit (object-level, Access = Internal) is wrapped in #if not CLEAN30 with no ObsoleteState/ObsoleteReason/ObsoleteTag ever set on the codeunit itself, so it skips the Pending deprecation stage entirely and jumps straight to a conditional removal. Elsewhere in this same app (e.g. PADemoGuide.Codeunit.al, which pairs #if not CLEAN28 with a [Obsolete('reason','28.0')] attribute on the retained stub procedure), obsoleted members carry explicit deprecation metadata alongside the CLEAN guard. This codeunit should be marked ObsoleteState = Pending (with reason/tag) in this release before the body is ever wrapped for removal.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

codeunit 3319 "PA Cost Estimate"
{
    Access = Internal;
    InherentEntitlements = X;
    InherentPermissions = X;
    Permissions = tabledata "Agent Task Consumption" = r;
    ObsoleteState = Pending;
    ObsoleteReason = 'The consumed credits information is no longer available.';
    ObsoleteTag = '29.0';

Knowledge:

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4

Comment thread src/Apps/W1/PayablesAgent/app/Setup/PayablesAgentSetup.Page.al Outdated
Comment thread src/Apps/W1/PayablesAgent/app/Billling/PACostEstimate.Codeunit.al Outdated
@Explorer986
Explorer986 force-pushed the private/kumarjatin/646660 branch from 7816510 to 74c4df3 Compare August 14, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants