feat(langgraph): emit a progress milestone when an oversized subtopic batch is rejected
Summary
When research_subtopic rejects a batch above the hard limit (>10 subtopics), it returns the error text to the lead agent and logs a warning, but never calls progress_callback — so progress-UI consumers never see that a batch was rejected and why.
| Field | Value |
|---|---|
| Severity | suggested (review section was Should-fix; downgraded on promotion — the review itself frames this as "design choice, not a defect", impact is observability-only) |
| Origin | Review of #5390 (post-merge extraction) |
| Review section | Should-fix |
| Classification | PR-introduced (rejection path added in #5390) |
| Verified at | main@99c07fe97fca |
| Dedup | distinct · 0 hits reviewed |
Trigger
Invoke research_subtopic with 11+ subtopics: the requested_count > MAX_SUBTOPICS_HARD_LIMIT branch logs logger.warning and returns the rejection string before any progress_callback emission; the queued-overflow path further down does emit progress + metadata, so the two paths are observably inconsistent.
Impact
Research-progress UIs show nothing for a rejected batch — the run appears to silently skip a step; only the lead agent's text and container logs carry the reason.
Pinned evidence
99c07fe97fca:src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py:L629-L641— hard-limit rejection: warning + return, no progress emission99c07fe97fca:src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py:L728-L746— the overflow path that does callprogress_callback(and attaches overflow metadata)
Fix direction
Emit a milestone before returning, e.g. progress_callback(f"Rejected batch of {requested_count} subtopics (hard limit {MAX_SUBTOPICS_HARD_LIMIT})", None, {"overflow_strategy": "rejected"}), and relax/extend the rejection tests to expect it.
Targeted tests
Add/extend a case in TestResearchSubtopicToolOverflow: invoke with 11 subtopics, assert the captured progress_callback received the rejection milestone and the return text still carries the split-into-batches guidance.
Provenance
Extracted from review of PR #5390 (post-merge extraction).
Source: LearningCircuit/local-deep-research