Open
Conversation
…igent-ai/eigent into refactor/refactor_chat_service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
refactor 1 / n
Source split:
backend/app/service/chat_service.py → backend/app/service/chat_service/ ├── __init__.py — Public API re-exports ├── step_solve.py — Main async generator loop (was step_solve function) ├── question_router.py — Query classification + simple answer routing (was question_confirm/simple_answer calls + routing logic) ├── handlers.py — Action handlers: improve, pause, resume, end, new_task, etc. ├── lifecycle.py — Agent/workforce construction: construct_workforce, new_agent_model, install_mcp ├── decomposition.py — Task decomposition: make_sub_tasks, start_workforce └── types.py — StepSolveState dataclass (shared mutable state for the loop)Functions moved to agent layer:
Shared constants extracted:
chat_service.py → backend/app/agent/prompt.py ├── AGENT_ENVIRONMENT_PROMPT — Platform/working-dir/date template (was duplicated 4x inline) ├── DEVELOPER_WORKER_DESCRIPTION — Workforce agent description (was inline string in construct_workforce) ├── BROWSER_WORKER_DESCRIPTION — Same ├── DOCUMENT_WORKER_DESCRIPTION — Same └── MULTI_MODAL_WORKER_DESCRIPTION — SameContext utilities extracted:
Testing Evidence (REQUIRED)
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement