Skip to content

Add optional paper-research routing to Team workflow with fallback and robustness fixes#2022

Open
ShuangJinl wants to merge 5 commits into
FoundationAgents:mainfrom
ShuangJinl:paper-research-pr-clean
Open

Add optional paper-research routing to Team workflow with fallback and robustness fixes#2022
ShuangJinl wants to merge 5 commits into
FoundationAgents:mainfrom
ShuangJinl:paper-research-pr-clean

Conversation

@ShuangJinl
Copy link
Copy Markdown

Features

  1. Add optional paper-research capability to startup routing while preserving the original software workflow as default.
  2. Introduce IntentClassificationAction for paper/software intent prediction with topic and confidence output.
  3. Keep deterministic regex router as fallback when classifier fails or confidence is low.
  4. Add lightweight LiteratureReviewAction (arXiv-based) to prepare pre-review context for collaboration.
  5. Integrate paper-oriented collaboration mode into software_company without breaking existing Team software flow.
  6. Improve runtime robustness:
    · handle mime_type=None safely in text-file detection (repo_to_markdown),
    · accept extra LLM-generated kwargs (e.g., description) in Editor.write.
  7. Improve command parsing robustness in role_zero_utils by extracting first valid JSON payload from mixed LLM output.
  8. Add focused tests for intent routing and fallback behavior.
  9. Update .pre-commit-config.yaml to use HTTPS repos for CI compatibility.

Feature Docs

Main use case:
metagpt "please find me some essay about machine learning"
Expected artifacts (example run):
workspace/paper_search_result.md
paper-collaboration planning/analysis markdown files generated by Team roles.

Influence

  1. Default software-company path is preserved (no breaking change to normal software tasks).
  2. New paper capability is optional and guarded by fallback logic.
  3. Startup routing and role collaboration behavior are the main impacted areas.
  4. Tool execution stability is improved for file reading/writing edge cases.

Result

Local focused tests passed:

python -m pytest -q -o addopts="" --confcutdir=tests/metagpt tests/metagpt/test_intent_router.py tests/metagpt/test_software_company_paper_mode.py
python -m pytest -q -o addopts="" --confcutdir=tests/metagpt tests/metagpt/roles/di/test_role_zero.py
pre-commit run --all-files executed locally, auto-fixes applied, and follow-up style commit pushed.

Other

This PR includes an extension beyond pure software generation.
If maintainers prefer narrower scope for main, I can split this into two PRs:

  • core robustness improvements aligned with existing software workflow,
  • optional paper-research extension for separate review (Draft PR / feature branch).

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.

2 participants