feat(agent-office): ytpub_retry 텔레그램 콜백 → music-lab retry 프록시
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,9 @@ async def _handle_callback(callback_query: dict) -> Optional[dict]:
|
||||
if callback_id.startswith("issue_"):
|
||||
return await _handle_insta_issue(callback_query, callback_id)
|
||||
|
||||
if callback_id.startswith("ytpub_retry_"):
|
||||
return await _handle_ytpub_retry(callback_query, callback_id)
|
||||
|
||||
cb = get_telegram_callback(callback_id)
|
||||
if not cb:
|
||||
return None
|
||||
@@ -169,6 +172,30 @@ async def _handle_insta_issue(callback_query: dict, callback_id: str) -> dict:
|
||||
return {"ok": False, "error": str(e)}
|
||||
|
||||
|
||||
async def _handle_ytpub_retry(callback_query: dict, callback_id: str) -> dict:
|
||||
"""ytpub_retry_{pipeline_id} 콜백 → music-lab pipeline retry 프록시."""
|
||||
from .. import service_proxy
|
||||
from .messaging import send_raw
|
||||
|
||||
await api_call(
|
||||
"answerCallbackQuery",
|
||||
{"callback_query_id": callback_query["id"], "text": "재시도 요청 중..."},
|
||||
)
|
||||
|
||||
try:
|
||||
pid = int(callback_id.removeprefix("ytpub_retry_"))
|
||||
except (ValueError, AttributeError):
|
||||
return {"ok": False, "error": "invalid_callback_data"}
|
||||
|
||||
res = await service_proxy.pipeline_retry(pid)
|
||||
sc = res.get("status_code")
|
||||
if sc in (200, 202):
|
||||
await send_raw(text=f"🔄 파이프라인 #{pid} 재개: {res.get('retrying_step', '?')}")
|
||||
else:
|
||||
await send_raw(text=f"⚠️ 재개 불가 (#{pid}): {res.get('detail', sc)}")
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
async def _handle_message(message: dict, agent_dispatcher) -> Optional[dict]:
|
||||
"""슬래시 명령 메시지 처리."""
|
||||
from .router import parse_command, resolve_agent_command, HELP_TEXT
|
||||
|
||||
Reference in New Issue
Block a user