Skip to content

refactor(frontend): extract agent payload and ReActStep mapping helpers#5995

Draft
Ma77Ball wants to merge 2 commits into
apache:mainfrom
Ma77Ball:refactor/agent-service-mapping-helpers
Draft

refactor(frontend): extract agent payload and ReActStep mapping helpers#5995
Ma77Ball wants to merge 2 commits into
apache:mainfrom
Ma77Ball:refactor/agent-service-mapping-helpers

Conversation

@Ma77Ball

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Added a private mapApiAgentInfo(api) helper in AgentService and routed createAgent, getAgent, and getAllAgents through it, removing three identical inline ApiAgentInfo -> AgentInfo mappings (including the duplicated delegate sub-mapping).
  • Added a private convertApiReActSteps(steps) helper and routed the three steps.map(s => convertApiReActStep(s)) sites through it.
  • No behavior change: the produced AgentInfo and ReActStep[] values are identical to before.

Any related issues, documentation, discussions?

Closes: #5990

How was this PR tested?

  • Run cd frontend && yarn test --include='**/agent.service.spec.ts', expect the existing AgentService suite (including the createAgent cases that flush an API payload and assert the mapped AgentInfo) to pass.
  • Typecheck with cd frontend && npx tsc --noEmit -p tsconfig.json, expect no errors in agent.service.ts (the only error is a pre-existing unrelated missing-module in migration-llm.ts).

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.8 in compliance with ASF

added a mapper convertApireActSteps... helper function to handle agent
get and create calls
@github-actions github-actions Bot added refactor Refactor the code frontend Changes related to the frontend GUI labels Jun 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @bobbai00
    You can notify them by mentioning @bobbai00 in a comment.

@codecov-commenter

codecov-commenter commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.85%. Comparing base (0e0ec11) to head (7583e55).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5995      +/-   ##
============================================
+ Coverage     56.23%   56.85%   +0.61%     
  Complexity     2987     2987              
============================================
  Files          1120     1123       +3     
  Lines         43167    43522     +355     
  Branches       4658     4705      +47     
============================================
+ Hits          24274    24743     +469     
+ Misses        17472    17304     -168     
- Partials       1421     1475      +54     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 3e88425
agent-service 44.59% <ø> (ø) Carriedforward from 3e88425
amber 57.77% <ø> (ø) Carriedforward from 3e88425
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 3e88425
config-service 51.56% <ø> (ø) Carriedforward from 3e88425
file-service 59.02% <ø> (ø) Carriedforward from 3e88425
frontend 50.91% <100.00%> (+1.63%) ⬆️
notebook-migration-service 78.57% <ø> (ø) Carriedforward from 3e88425
pyamber 90.20% <ø> (ø) Carriedforward from 3e88425
python 90.76% <ø> (ø) Carriedforward from 3e88425
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 3e88425

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deduplicate agent payload and ReActStep mapping in AgentService

2 participants