Full abort signal chain: Gateway → ConversationService → Coordinator →
ToolExecutor → BaseSpecialist → Claude API stream. Admin can toggle between
v1 (post-completion re-evaluation) and v2 (interruptible) via REST API.
Changes:
- Gateway: add cancel_stream WebSocket handler + active stream tracking
- Gateway: abort active stream on client disconnect
- ConversationService: accept + forward AbortSignal
- CoordinatorAgentService: link external AbortSignal to internal controller,
thread through tool executor, read assessment mode from Redis feature flag
- BaseSpecialistService: hard abort (throw) instead of soft break,
add abort signal to Promise.race in callClaude(), abort stream on cancel
- ImmigrationToolsService: thread abortSignal to assessment expert
- AdminObservabilityController: GET/PUT feature-flags/assessment-mode
(Redis-backed, defaults to v1)
v1 and v2 coexist — admin controls which mode is active.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When users correct or update personal info after assessment completion,
Coordinator can now re-run run_professional_assessment with forceReassess: true
to bypass the 30-day dedup and produce an updated report.
Changes:
- Add forceReassess boolean param to run_professional_assessment tool definition
- Skip already_assessed check when forceReassess=true in handler
- Add prompt rules for identifying info corrections and triggering re-evaluation
- Document the re-evaluation flow in sections 3.5 and 4.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two hardening fixes for the professional assessment pipeline:
1. Code-level payment verification before dispatching invoke_assessment_expert
(prevents bypassing the prompt-only gate)
2. Thread onProgress callback through direct tool chain so run_professional_assessment
streams agent_progress events during the 30-45s assessment expert execution
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces ad-hoc assessment flow with structured pipeline:
- Code-level payment verification (checks PAID ASSESSMENT order)
- Info completeness validation (age, nationality, education, work exp)
- Assessment expert invocation with result parsing
- Automatic persistence as UserArtifact (assessment_report type)
- 30-day dedup (existing report within 30 days returns cached)
- Frontend rendering for all status codes (completed, payment_required,
info_incomplete, already_assessed, error)
- System prompt updated to mandate new tool for paid assessments
- Post-assessment auto-generation of checklist + timeline
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 4 new tools (generate_document, manage_checklist, create_timeline,
query_user_artifacts) enabling the agent to create and manage persistent
user artifacts. Artifacts are saved to PostgreSQL and support dedup by
title, update-in-place, and cross-session querying. Frontend renders
rich UI cards for each artifact type.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Alipay/WeChat adapters now return the source payment URL alongside the
QR base64. The generate_payment tool only returns paymentUrl (short text)
to Claude API — base64 qrCodeUrl is stripped to prevent AI from dumping
raw data:image into text responses. Frontend QRCodeSVG renders from
paymentUrl instead of base64.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the following real-time tools to ImmigrationToolsService:
- get_current_datetime: Get current date/time with timezone support
- web_search: Search internet for latest immigration news/policies (Google CSE)
- get_exchange_rate: Query real-time currency exchange rates (for investment immigration)
- fetch_immigration_news: Fetch latest immigration announcements
All tools include graceful degradation with fallback responses when external APIs are unavailable.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>