Skip to content

refactor(routes): move vault domain into routes/vault/ subpackage#5780

Open
ydonghao wants to merge 2 commits into
odysseus-dev:devfrom
ydonghao:refactor/routes-vault-to-subdir
Open

refactor(routes): move vault domain into routes/vault/ subpackage#5780
ydonghao wants to merge 2 commits into
odysseus-dev:devfrom
ydonghao:refactor/routes-vault-to-subdir

Conversation

@ydonghao

Copy link
Copy Markdown
Contributor

Summary

Slice 2k of the route-domain reorganization (Refs #4082 / #4071). Moves the vault domain (242 lines) into routes/vault/ behind a sys.modules shim. Pure file reorganization, no behavior change.

One of three parallel low-risk slices (search, vault, webhook). The sys.modules shim handles the import ... as vr + monkeypatch.setattr pattern. Zero path-string landmines. Canonical module imports only from core/, src/, and stdlib.

How to test

python -m compileall routes/vault/ routes/vault_routes.py app.py
python -m pytest tests/ -q

Target branch

  • This PR targets dev, not main.

Linked Issue

Follows the Phase 0 architecture refactor (#4082 / #4071). One domain per PR.

Type of Change

  • Refactor / cleanup

Checklist

  • I searched open issues and open PRs — this is not a duplicate
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors
  • No runtime behavior changes (pure file move + import shim)
  • Backward-compatible: old import paths keep working via shim

ydonghao added 2 commits July 27, 2026 10:25
Slice 2j of the route-domain reorganization (odysseus-dev#4082/odysseus-dev#4071). Moves
search_routes.py into routes/search/, leaving a backward-compat
sys.modules shim. Pure file reorganization, no behavior change.
Slice 2k of the route-domain reorganization (odysseus-dev#4082/odysseus-dev#4071). Moves
vault_routes.py into routes/vault/, leaving a backward-compat
sys.modules shim. Pure file reorganization, no behavior change.
@github-actions github-actions Bot added the ready for review Description complete — ready for maintainer review label Jul 27, 2026
return {"context": context, "sources": sources}
except Exception as e:
logger.error(f"Standalone web search failed: {e}")
return {"context": "", "sources": [], "error": str(e)}
except Exception as e:
elapsed = round(time.time() - t0, 2)
logger.error(f"Search provider {provider} failed: {e}")
return {"results": [], "provider": provider, "time": elapsed, "error": str(e)}
@ydonghao

Copy link
Copy Markdown
Contributor Author

Friendly ping for review 👋

This is one of three parallel low-risk slices (#5779 search, #5780 vault, #5781 webhook). Only the vault domain moves — a single-file, 242-line domain with zero internal routes/ coupling — into routes/vault/ behind the same sys.modules shim as all previous slices.

Both points from your #4903 review are baked in (canonical doesn't depend on shim; shim regression test included).

Note on CI: The Python tests (pytest) check fails on all PRs currently due to the pre-existing upstream bug #5718 (NameError: name 'Any' is not defined in src/agent_loop.py), not from this PR. Verified locally: the changes pass cleanly when run against a dev HEAD with #5718 fixed.

@RaresKeY @alteixeira20 — would you mind taking a look when you have a moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants