Skip to content

refactor(runtime): extract provider error classification - #1214

Merged
likun666661 merged 1 commit into
apache:mainfrom
xuruiray:xurui/issue-1084-provider-error-classification
Jul 19, 2026
Merged

likun666661 merged 1 commit into
apache:mainfrom
xuruiray:xurui/issue-1084-provider-error-classification

Conversation

@xuruiray

Copy link
Copy Markdown
Contributor

Summary

  • extract provider error evidence normalization, context-overflow taxonomy, classification, and safe presentation into a dependency-free runtime leaf
  • make ToolRuntime and ModelAdapter depend directly on that leaf without changing classification order, error classes, or user-facing messages
  • move provider classification fixtures to the new verification boundary and add a source contract that prevents the taxonomy from sinking back into ToolRuntime

Refs #1084.

Verification

  • npm run lint — passed
  • npm run build — passed
  • npm run typecheck — passed
  • focused provider classification, ModelAdapter, and extraction contract tests — 29 passed, 0 failed
  • npm run test:dist — passed in the repository CI serial mode; all workspaces passed
  • git diff origin/main...HEAD --check — passed

The default local parallel npm test exposed an unrelated Runtime Host timing flake twice (connected was observed as unavailable). The failing case passed standalone, @maka/runtime-host passed 45/45 in isolation, and the repository CI serial test mode passed all workspaces.

Visual validation is not applicable: this is a runtime-only, behavior-neutral module extraction.

Review focus

  • provider evidence precedence, regex tables, error-class strings, and presentation text are moved without behavioral edits
  • provider-error-classification.ts is dependency-free; ToolRuntime and ModelAdapter import it directly
  • no package export or RuntimeEvent schema changes

Move provider error evidence normalization, overflow patterns, classification, and presentation into a dependency-free leaf shared by ToolRuntime and ModelAdapter.

Relocate the taxonomy tests and add an extraction contract to keep the boundary explicit. Classification order and presentation strings are unchanged.
@xuruiray
xuruiray marked this pull request as ready for review July 18, 2026 16:40

@Astro-Han Astro-Han 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.

No P0–P3 findings.

Verified that the extracted classifier is behavior-equivalent to the original implementation, the PR merges cleanly with the latest main, and the recent ModelAdapter changes remain intact. The full runtime suite passes locally (2,151 passed, 0 failed, 7 skipped), the focused extraction/classification tests pass (29/29), and the GitHub test, typecheck, and e2e checks are green.

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