Skip to content

refactor(api): isolate console Agent provider discovery - #44418

Open
Bear0117 wants to merge 2 commits into
langgenius:mainfrom
Bear0117:codex/console-agent-providers-application-service
Open

Bear0117 wants to merge 2 commits into
langgenius:mainfrom
Bear0117:codex/console-agent-providers-application-service

Conversation

@Bear0117

@Bear0117 Bear0117 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of #39993. Provider discovery is the independent portion of the family claimed in #39993 (comment). Agent logs are being handled separately in #43688.

Move the two Console Agent provider endpoints from the static AgentService methods to an injected AgentProviderService with a plugin-runtime gateway. Both handlers use console_account_admission; the service derives the workspace from the admitted RequestContext.

Reuse the existing plugin declaration DTOs so list/detail response schemas and serialized fields stay unchanged. Provider lookup client errors retain the existing ValueError / 400 behavior; list and unexpected runtime failures keep their existing propagation. Add controller/application import-linter contracts.

The legacy AgentService remains available for the separate logs migration and compatibility callers.

Validation

  • 121 tests passed across provider application/gateway tests, provider controller/schema tests, and composition-root tests.
  • Coverage includes workspace propagation, plugin error translation, unexpected failures, and preservation of nested provider declaration fields. The success-path tests run the real PluginAgentClient with its daemon transport replaced, checking provider ID normalization and tenant-specific paths.
  • Ruff check/format and Pyrefly on changed production and test files passed.
  • Import linter: 71 contracts kept, 0 broken.
  • Response-contract lint: 599 valid, 0 mismatch, 0 refactorable.
  • Spec-mock guard and git diff --check passed.

From Codex

@github-actions github-actions Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 76.28% 76.29% +0.01%
Strict coverage 75.96% 75.97% +0.01%
Typed symbols 64,406 64,429 +23
Untyped symbols 20,108 20,108 0
Modules 3834 3837 +3

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.78%. Comparing base (4f763a8) to head (41d19a7).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44418   +/-   ##
=======================================
  Coverage   88.78%   88.78%           
=======================================
  Files        5553     5555    +2     
  Lines      332847   332874   +27     
  Branches    66591    66589    -2     
=======================================
+ Hits       295503   295548   +45     
+ Misses      32162    32148   -14     
+ Partials     5182     5178    -4     
Flag Coverage Δ
api 88.85% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. 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

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant