Skip to content

🚀 Upgrade Fraud Detection Workflow to current version Agent Framework 1.0.0b260130#376

Merged
james-tn merged 5 commits intoint-agenticfrom
james-dev
Feb 4, 2026
Merged

🚀 Upgrade Fraud Detection Workflow to current version Agent Framework 1.0.0b260130#376
james-tn merged 5 commits intoint-agenticfrom
james-dev

Conversation

@james-tn
Copy link
Contributor

@james-tn james-tn commented Feb 3, 2026

Summary
This PR upgrades the Fraud Detection workflow application to use the new Agent Framework API, which includes breaking changes to the human-in-the-loop pattern. The migration replaces the deprecated RequestInfoExecutor pattern with the new ctx.request_info() and @response_handler decorator pattern.

Breaking Changes in Agent Framework
The following APIs were removed in the new version:

RequestInfoExecutor class
RequestInfoMessage base class
RequestResponse class
run_stream_from_checkpoint() method
The following APIs were added:

ctx.request_info(request_data, response_type) - Pauses workflow and emits RequestInfoEvent
@response_handler decorator - Handles responses when workflow resumes
get_checkpoint_summary(checkpoint) - Returns pending request info events
workflow.send_responses_streaming(responses) - Sends responses and continues workflow
Changes
Workflow Code (fraud_detection_workflow.py)
Replaced RequestInfoExecutor with ReviewGatewayExecutor that uses ctx.request_info()
Changed AnalystReviewRequest from RequestInfoMessage subclass to plain @DataClass
Added @response_handler decorated method to handle analyst decisions
Updated workflow builder to remove RequestInfoExecutor node and edges
Backend (backend.py)
Added UTF8FileCheckpointStorage wrapper class to fix Windows encoding issues with Unicode characters in LLM output
Updated checkpoint resolution to use get_checkpoint_summary().pending_request_info_events
Fixed checkpoint resolution timing - broadcast decision_required immediately, resolve checkpoint after SuperStepCompletedEvent
Updated resume logic to use run_stream(checkpoint_id=...) + send_responses_streaming(responses)
Added extensive debug logging for troubleshooting
Frontend
WorkflowVisualizer.jsx: Removed analyst_review node, updated edges so review_gateway connects directly to fraud_action_executor
useWebSocket.js: Added message queue to prevent lost messages during rapid React state updates
AnalystDecisionPanel.jsx: Made panel more compact with max height
App.jsx: Adjusted grid layout (Left: 2, Center: 7.5, Right: 2.5)
Documentation
Updated README.md with new architecture diagram and API references
Updated IMPLEMENTATION.md with new code examples
Updated QUICKSTART.md with new configuration instructions
Updated scenario.md to reference ReviewGatewayExecutor
Added troubleshooting entries for Windows encoding issues
Testing
✅ Workflow starts and processes alerts correctly
✅ Fan-out to 3 specialist executors works
✅ Fan-in aggregation produces risk assessment
✅ High-risk alerts trigger human-in-the-loop review
✅ Analyst decision panel appears in UI
✅ Checkpoints are saved with UTF-8 encoding (Windows fix)
✅ Workflow resumes after analyst decision
Migration Notes
If you have custom implementations using the old API, migrate as follows:

Before (deprecated):

    data: str

analyst_review = RequestInfoExecutor(name="review", request_info={...})
builder.add_edge(source, analyst_review)

After (new API):

@dataclass
class MyRequest:
    data: str

class ReviewGatewayExecutor(Executor):
    async def handle_input(self, ctx, input_data):
        request = MyRequest(data=input_data)
        await ctx.request_info(request, MyResponse)
    
    @response_handler
    async def handle_response(self, ctx, response: MyResponse):
        await ctx.send_message(response)
        

Dependencies
Updated pyproject.toml to use latest agent-framework version
Regenerated uv.lock with updated dependencies

@james-tn james-tn merged commit f773485 into int-agentic Feb 4, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant