Skip to content

refactor(routes): move webhook domain into routes/webhook/ subpackage#5781

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

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

Conversation

@ydonghao

Copy link
Copy Markdown
Contributor

Summary

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

One of three parallel low-risk slices (search, vault, webhook). One source-introspection test site repointed (test_api_chat_security.py). Canonical module imports only from core/, src/, and stdlib.

How to test

python -m compileall routes/webhook/ routes/webhook_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 2l of the route-domain reorganization (odysseus-dev#4082/odysseus-dev#4071). Moves
webhook_routes.py into routes/webhook/, leaving a backward-compat
sys.modules shim. Pure file reorganization, no behavior change.
One source-introspection test repointed (test_api_chat_security.py).
@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)}
"user_message": message[:2000], "response": reply[:2000],
})

return {"response": reply, "session_id": session_id, "model": sess.model}
@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 webhook domain moves — a single-file, 395-line domain with zero internal routes/ coupling — into routes/webhook/ 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