Skip to content

fix(wake): resolve_branch falls back to caller project registry for cross-project dispatch#285

Merged
AIOSAI merged 1 commit intomainfrom
fix/wake-cross-project-resolve
Apr 15, 2026
Merged

fix(wake): resolve_branch falls back to caller project registry for cross-project dispatch#285
AIOSAI merged 1 commit intomainfrom
fix/wake-cross-project-resolve

Conversation

@AIOSAI
Copy link
Copy Markdown
Owner

@AIOSAI AIOSAI commented Apr 15, 2026

Summary

Fixes #283.

When an external project (e.g. Vera-Studio) called drone @ai_mail dispatch @strategy "msg" "body", email delivery worked (delivery.py already had a caller-registry fallback via AIPASS_CALLER_CWD) but wake failed with Branch not found: @strategy because resolve_branch() in wake.py only checked AIPASS_REGISTRY.json.

Root cause

wake.py::resolve_branch() had no fallback to the caller's project registry. delivery.py::_load_caller_project_branches() had the full implementation but it was private and duplicated.

Fix

  • Extracted the registry-walking logic into a new shared function get_caller_project_branches(caller_cwd) in apps/handlers/registry/read.py
  • Updated wake.py::resolve_branch() to check the AIPass registry first, then fall back to the caller's project registry via AIPASS_CALLER_CWD (same env var delivery.py already uses)
  • Simplified delivery.py::_load_caller_project_branches() to delegate to the shared function, eliminating the duplicate implementation
  • Updated .seedgo/bypass.json with correct entries for all new cross-handler imports and nesting

Test plan

  • TestGetCallerProjectBranches (7 new tests in test_registry_read.py): covers list format, dict format, relative path resolution, parent-directory walking, empty result
  • TestResolveBranchCallerRegistry (3 new tests in test_wake.py): covers cross-project fallback, AIPass-registry-takes-precedence, not-found-anywhere
  • All 325 pre-existing tests continue to pass (334 total: 325 + 9 new)

🤖 Generated with Claude Code

…ross-project dispatch

Email delivery to external branches (e.g. @strategy in Vera-Studio) worked
because delivery.py already had a caller-registry fallback, but wake failed
with "Branch not found" because resolve_branch() only checked AIPASS_REGISTRY.

Extracted the shared registry-walking logic into
registry/read.py::get_caller_project_branches(), then:
- wake.py resolve_branch() now checks AIPASS_REGISTRY first, then falls back
  to the caller's project registry via AIPASS_CALLER_CWD (cross-project wake)
- delivery.py _load_caller_project_branches() delegates to the shared function
  (eliminates duplicate implementation)

Fixes #283.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AIOSAI AIOSAI merged commit b5b0343 into main Apr 15, 2026
5 of 6 checks passed
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]: drone @ai_mail dispatch wake fails with 'Branch not found' when called cross-project

1 participant