Skip to content

fix(cli): fall back when a running server's config file can't be found - #771

Closed
nurlanmnn wants to merge 1 commit into
agentscope-ai:mainfrom
nurlanmnn-open-source:fix-running-config-oserror
Closed

nurlanmnn wants to merge 1 commit into
agentscope-ai:mainfrom
nurlanmnn-open-source:fix-running-config-oserror

Conversation

@nurlanmnn

Copy link
Copy Markdown

Summary

running_app_config() replays the running reme start ... args through resolve_app_config, but only caught ValueError. If the server was started with a relative config path from another folder, the file can't be found from the client's folder, FileNotFoundError escapes, and every reme <action> call crashes instead of falling back to local config.

This catches (OSError, ValueError) and moves on to the next candidate, the same way _scan_reme_procs() in the same file already does.

Related issue

Fixes #770

Contract and data impact

  • No public configuration, schema, CLI, endpoint, streaming, or workspace-layout contract changes
  • No user-owned memory files are deleted or rewritten
  • Derived indexes, catalogs, graphs, caches, and metadata remain rebuildable

Validation

  • Focused tests pass: pytest tests/unit/test_service_utils.py → 27 passed. The 2 new tests fail on main with FileNotFoundError and pass with this change.
  • Unit tests pass, or omitted tests are explained below
  • pre-commit run --all-files passes, or omitted checks are explained below
  • Frontend checks were run when reme_studio/ changed (not changed)

I ran pre-commit run --files on the two changed files (black, flake8, pylint, pyroma all passed). I also ran the whole tests/unit folder with .[dev,as] installed: 3479 passed, and the 51 failures are in files this PR doesn't touch (cc_agent_wrapper, file_graph, tokenizer, outbound_proxy and a few more), mostly because optional extras like claude_agent_sdk and openai_codex aren't installed here.

Checklist

  • I reviewed the diff for unrelated changes and sensitive data
  • Tests cover intentional behavior changes
  • Defaults, schemas, and concise documentation were updated together when required
  • Long-lived clients, tasks, services, and executors follow the application lifecycle

Screenshots or additional notes

Two new tests: one where the only running server has a missing relative config (returns None now), and one where a later candidate is valid and still gets used.

I used Claude Code and Codex to help find and fix this. I checked the change and ran the tests myself.

🤖 Generated with Claude Code

running_app_config() replays each running 'reme start' command line, but it only caught ValueError. When the server was started with a relative config path from another directory, resolve_app_config raised FileNotFoundError and every 'reme <action>' call crashed instead of falling back to local config. Catch OSError too, like _scan_reme_procs already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jinliyl

jinliyl commented Nov 21, 2026

Copy link
Copy Markdown
Member

Thanks, Nurlan, for reporting #770, putting together a fix, and adding regression tests.

I reproduced the cross-directory case with a real HTTP server on a non-default port. The CLI discovery changes in #769 are now on main and resolve relative config paths from the server process's working directory. I verified that this works even when the client directory has a config file with the same name. I also confirmed that the CLI falls back to the caller's config if the server's config file is removed after startup.

Since #769 covers the reported issue, I think we can close this PR.

@nurlanmnn

Copy link
Copy Markdown
Author

Thanks for checking it end to end. Agreed, #769 covers this, closing.

@nurlanmnn nurlanmnn closed this Nov 23, 2026
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.

[Bug]: reme CLI crashes when the running server used a relative config path

3 participants