Loading pair-programming exercise

Debug a Production Support Proposal Workflow

A support team wants agents to research a ticket and propose one controlled action for application code to review.

A production boundary around an agent-generated proposal

The supplied CrewAI adapter owns agents, tasks, and framework output. The editable workflow owns ordinary application guarantees: request identity, tenant isolation, deduplication, and whether the proposal cites evidence that was actually supplied.

Your task

Repair three plain-Python defects in SupportProposalWorkflow. No CrewAI API knowledge is required; treat the supplied proposal client like any other dependency.

Pairing tasks

  1. Run the tests and use each failure to identify the violated production contract.
  2. Return the saved proposal before calling the external proposal client again.
  3. Include tenant_id in the request sent through the adapter.
  4. Reject proposal evidence IDs that were not supplied with this request.

Trace one request from validation to the injected proposal client, evidence checks, and the idempotency store. Explain which checks must happen before the external call.

Interviewer follow-up questions

  • Why must the idempotency lookup happen before the external call?
  • What could happen if tenant identity is omitted from the adapter request?
  • Why is structured output still untrusted application input?
  • Where would timeout and tracing wrap the proposal client call?

Skills: Workflow orchestration · Idempotency · Tenant isolation · Evidence validation

Exercises

Pair Programming22 exercises