Skip to content

Commit 5d5f03e

Browse files
author
J.A.R.V.I.S.
committed
feat(v3.19): POST /tasks/create skill_id validation + _create_task propagation
1 parent 0b2fa91 commit 5d5f03e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

relay/acp_relay.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13987,13 +13987,27 @@ async def _send_fed():
1398713987
return
1398813988
# Attach validated token fields to task for audit
1398913989
log.info(f"🎫 capability_token validated: jti={raw_cap_token.get('jti')} skill={skill_id_for_tier}")
13990+
# ── v3.19: skill_id routing — validate skill exists in AgentCard ──────────
13991+
if skill_id_for_tier:
13992+
_skill_valid, _skill_err = _validate_skill_id(skill_id_for_tier, peer_id=caller_peer_id)
13993+
if not _skill_valid:
13994+
self._json({
13995+
"ok": False,
13996+
"error_code": ERR_SKILL_NOT_FOUND,
13997+
"error": _skill_err,
13998+
"skill_id": skill_id_for_tier,
13999+
"peer_id": caller_peer_id,
14000+
}, 400)
14001+
return
14002+
1399014003
# v2.51: T3 human_confirmation_required gate
1399114004
t3_confirm = _needs_human_confirmation(skill_id_for_tier)
1399214005
task = _create_task(payload,
1399314006
message_id=body.get("message_id"),
1399414007
task_id=body.get("task_id"), # BUG-006 fix: pass client task_id
1399514008
context_id=body.get("context_id"), # v1.7: propagate context_id to SSE events
13996-
initial_state=TASK_CONFIRMATION_PENDING if t3_confirm else None)
14009+
initial_state=TASK_CONFIRMATION_PENDING if t3_confirm else None,
14010+
skill_id=skill_id_for_tier) # v3.19: skill_id routing
1399714011
# v2.52: audit skill_id + peer_id at task creation
1399814012
if skill_id_for_tier:
1399914013
_audit_card_skills = (_status.get("agent_card") or {}).get("skills", [])

0 commit comments

Comments
 (0)