fix(examples): align survey CSV schema#1465
Conversation
|
| 'behavioral_task', | ||
| 'summary', | ||
| 'disqualificationReason', | ||
| 'evaluation', |
There was a problem hiding this comment.
🟡 New evaluation CSV column is added but never populated
The evaluation column was added to CSV_COLUMNS at line 57, but neither of the two writeCsvRow call sites ever provides an evaluation key in the data object. The disqualify path (examples/src/survey_agent.ts:87-89) writes only name and disqualification_reason, and the normal completion path (examples/src/survey_agent.ts:349-353) writes name, the task results (intro_task, email_task, etc.), and summary. Since writeCsvRow maps each column to toCsvValue(data[key]) (examples/src/survey_agent.ts:71), the evaluation column will always be an empty string in every CSV row.
Prompt for agents
The evaluation column was added to CSV_COLUMNS in survey_agent.ts at line 57 but is never populated by any code path. There are two writeCsvRow call sites: one in disqualifyTool (line 87) and one in SurveyAgent.onEnter (line 355). Neither writes an evaluation key. Either the column should be removed from CSV_COLUMNS, or an evaluation step should be added (e.g. after the task group completes in SurveyAgent.onEnter) that computes an evaluation value and includes it in the mergedResults object before writing the CSV row.
Was this helpful? React with 👍 or 👎 to provide feedback.
Description
Fix three bugs in
examples/survey/survey_agent.py'swrite_to_csv: the header was never written (os.path.existsran afteraiofiles.open(..., "a")had already created the file),AsyncWriterhas nowriteheader()and was being mis-constructed (its second positional arg isdialect, not fieldnames), and the disqualify and success paths used disjoint column sets.Changes
AsyncDictWriterwith a fixedCSV_COLUMNStuple (extrasaction="ignore").await csvfile.tell() == 0after opening in append mode.disqualification_reason(was"disqualification reason").nameon the success path fromuserdata.candidate_name.Testing
make lint(ruff) passes locally.