modelscope / modelscope/ms-agent

Architecture-quality audit notes from hermescheck

Open
#911 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.4k
Forks
521
Avg merge
1d
Merged PRs (30d)
36

Description

Hi maintainers — this is a friendly architecture-quality audit note, not a security report.

I’ve been building hermescheck, a small open-source scanner that reviews AI agent runtimes for state recovery, memory drift, tool boundaries, scheduler behavior, and other long-running agent failure modes. I ran it against modelscope/ms-agent because this repo is an active agent runtime/framework with real CLI, web UI, workflow, memory, and tool-execution surfaces.

Three runtime/architecture notes that looked worth sharing:

  1. Recovery currently looks transcript-heavy rather than fully resumable.
    ms_agent/utils/utils.py persists config + message history, and ms_agent/llm/openai_llm.py continues long generations, but I didn’t see the same level of durable environment / side-effect / restart contract around those flows. That can make interrupted work harder to resume deterministically.

  2. Web UI session state appears in-memory and explicit-delete driven.
    webui/backend/session_manager.py keeps sessions, messages, and deep-research events in process memory, and webui/backend/websocket_handler.py mainly cleans up task/runner references on stop or completion. This felt a bit fragile for server restarts or abandoned sessions if the goal is durable operator-facing workflows.

  3. Memory surfaces look split across several layers without one obvious freshness contract.
    I saw cache/history handling in ms_agent/utils/utils.py, long-term memory logic in ms_agent/memory/default_memory.py, and separate condenser/default-memory surfaces under ms_agent/memory/. The architecture may benefit from a clearer “authoritative current memory vs derived/archive/cache layers” rule.

None of the above is meant as “you must change this”; it just looked like a useful maintainer-facing architecture snapshot from an external pass.

Repo for the tool: https://github.com/huangrichao2020/hermescheck

If this isn’t useful, feel free to close and I won’t take it personally.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading ms_agent/utils/utils.py, ms_agent/llm/openai_llm.py, webui/backend/session_manager.py, webui/backend/websocket_handler.py, and the files under ms_agent/memory/. The audit identifies possible recovery, session durability, and memory-freshness concerns, but provides no failing test, concrete change, acceptance criteria, or definition of done.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.