All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 8s
The original implementation only returned issues with a plugin_state
linkage (legal-case-number key), which was set just on the initial
setup issue. Sub-agents that created follow-up issues during the case
workflow tagged them in the title ("[ערר 1130-25] כתיבת החלטה" etc.)
but didn't write a plugin_state row, so 23 of 24 historical issues
for case 1130-25 were invisible to the agent activity feed.
Widened the lookup to UNION two paths:
(a) plugin_state.scope_id matches via the legal-case-number key
(b) issues.title LIKE '%[ערר {case_number}]%' OR '%ערר {case_number}%'
Used DISTINCT ON (i.id) + post-sort by created_at to dedupe and keep
chronological order. The widget on https://legal-ai.../cases/1130-25
will now show the full history (was 1 issue → now 16).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>