Skip to content

fix(examples): align survey CSV schema#1465

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
cosine-laughing-uncover
Open

fix(examples): align survey CSV schema#1465
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
cosine-laughing-uncover

Conversation

@rosetta-livekit-bot
Copy link
Copy Markdown
Contributor

@rosetta-livekit-bot rosetta-livekit-bot Bot commented May 12, 2026

Description

Fix three bugs in examples/survey/survey_agent.py's write_to_csv: the header was never written (os.path.exists ran after aiofiles.open(..., "a") had already created the file), AsyncWriter has no writeheader() and was being mis-constructed (its second positional arg is dialect, not fieldnames), and the disqualify and success paths used disjoint column sets.

Changes

  • Switch to AsyncDictWriter with a fixed CSV_COLUMNS tuple (extrasaction="ignore").
  • Decide on the header by checking await csvfile.tell() == 0 after opening in append mode.
  • Normalize the disqualify key to disqualification_reason (was "disqualification reason").
  • Populate name on the success path from userdata.candidate_name.

Testing

  • make lint (ruff) passes locally.
  • Manual reasoning only — example writes a local CSV.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

⚠️ No Changeset found

Latest commit: c2ab795

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

'behavioral_task',
'summary',
'disqualificationReason',
'evaluation',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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