Skip to content

Interview Agent Exit Conditions #46

@mathaix

Description

@mathaix

User Story

As a developer
I want Interview Agents to know when to exit the interview
So that interviews end naturally when goals are met

Overview

Interview agents need clear exit conditions based on the shared rubric and blueprint configuration. This ensures interviews end when sufficient data is collected, not arbitrarily.

Acceptance Criteria

Exit Condition Configuration

In AgentBlueprint:

class ExitConditions(BaseModel):
    required_fields_threshold: float = 1.0  # % of required fields captured
    max_turns: int = 30                     # Safety net
    graceful_closing: bool = True           # Natural wrap-up

Primary Gate: Rubric Completeness

  • Track which required rubric fields have been captured
  • Exit eligible when threshold met (default 100%)
  • Fields can be marked as:
    • Captured: Value extracted with evidence
    • Unknown: Interviewee doesn't know (logged as TODO)
    • Not Asked: Question not yet asked
  • Both "Captured" and "Unknown" count toward threshold

Unknown Field Handling

  • When interviewee says "I don't know" for required field
  • Mark as Unknown, log for follow-up
  • Create JIRA ticket or TODO item (Phase 2: actual integration)
  • Do NOT keep asking (no badgering)

Secondary Gate: LLM Assessment

  • Before exiting, agent self-assesses:
    • "Have I missed anything important?"
    • "Is there an unexplored thread worth pursuing?"
  • If yes, continue with follow-up
  • If no, proceed to exit

Safety Net: Max Turn Limit

  • Configurable max turns (default 30)
  • When reached, force graceful exit
  • Log warning that interview hit max turns

Graceful Closing

  • When exit conditions met, don't abruptly stop
  • Transition to closing sequence:
    • Thank the interviewee
    • "Is there anything else I should know?"
    • Final wrap-up
  • Then end interview

Exit Logic (Pseudocode)

async def should_exit_interview(state: InterviewState) -> bool:
    # Primary: rubric completeness
    required_captured = calculate_required_field_coverage(state)
    if required_captured < exit_conditions.required_fields_threshold:
        return False
    
    # Safety: max turns
    if state.turn_count >= exit_conditions.max_turns:
        return True
    
    # Secondary: LLM assessment
    should_continue = await llm_assess_completeness(state)
    return not should_continue

Technical Notes

  • Exit conditions part of AgentBlueprint schema
  • Rubric field tracking in interview state
  • LLM assessment uses lightweight prompt
  • Graceful closing uses closing_sequence from QuestionFlowSpec

Definition of Done

  • ExitConditions schema implemented
  • Rubric field tracking working
  • Unknown field handling with TODO logging
  • LLM assessment integrated
  • Max turn safety net working
  • Graceful closing implemented
  • Code reviewed and merged

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    blueprintInterview Blueprint relatedpriority:mustMust have (MoSCoW)storyUser story

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions