Skip to content

Conversation

@zhogu
Copy link

@zhogu zhogu commented Oct 16, 2025

This pull request refactors the chat plugin to simplify model selection and API interactions by removing job-based model fetching and related state. The code now fetches all available models directly from a unified model proxy endpoint, eliminating the need for job management logic. This streamlines the user interface and backend logic, making the codebase easier to maintain and understand.

Major refactoring and simplification:

  • Removed all job-related logic and state from the frontend, including the Job type, job selection UI, and associated API calls. The application no longer fetches or manages jobs, focusing solely on model selection. [1] [2] [3] [4] [5] [6] [7]

API and state management changes:

  • Replaced job-based model fetching (fetchModelsInCurrentJob) with a new fetchAllModels function that retrieves all models from a single model proxy endpoint, updating related API calls and state accordingly. [1] [2]
  • Updated chat request and streaming functions to use the unified model proxy endpoint and removed job-dependent parameters. [1] [2] [3]

Component and prop updates:

  • Updated the main App component and plugin initialization to remove job server and token props, reflecting the new simplified model. [1] [2] [3]

These changes collectively result in a cleaner, more maintainable codebase focused on direct model selection without the complexity of job management.

Copilot AI review requested due to automatic review settings October 16, 2025 10:47
@zhogu zhogu requested review from hippogr and yukirora October 16, 2025 10:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the chat plugin architecture by removing job-based model management and replacing it with a unified model proxy endpoint. The refactoring eliminates the complexity of managing jobs, job servers, and associated state, streamlining both the UI and backend logic to focus solely on direct model selection.

Key Changes:

  • Removed all job-related state, types, and UI components, including job selection dropdowns and job server configuration
  • Replaced job-based model fetching with a single fetchAllModels function that queries a unified model proxy endpoint
  • Updated API functions to use the model proxy path instead of job-specific endpoints for chat requests

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
contrib/chat-plugin/src/libs/state.ts Removed Job type and job-related state properties; replaced with simplified model proxy path and model list
contrib/chat-plugin/src/libs/api.ts Replaced job-based model fetching with unified fetchAllModels function; updated chat endpoints to use model proxy
contrib/chat-plugin/src/index.tsx Removed model token parameter from plugin initialization
contrib/chat-plugin/src/app/index.tsx Updated App component to remove job server path and token initialization
contrib/chat-plugin/src/app/JobBar.tsx Removed job selection UI and logic; simplified to only handle model selection and refresh

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yukirora yukirora mentioned this pull request Nov 4, 2025
26 tasks
@yukirora yukirora merged commit 2165ad2 into dev Nov 5, 2025
1 check passed
@yukirora yukirora mentioned this pull request Nov 11, 2025
25 tasks
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.

4 participants