Skip to content

fix: trim responses after think blocks - #346

Open
xkam7ar wants to merge 1 commit into
interviewstreet:mainfrom
xkam7ar:agent/hiring-agent-trim-think-response
Open

fix: trim responses after think blocks#346
xkam7ar wants to merge 1 commit into
interviewstreet:mainfrom
xkam7ar:agent/hiring-agent-trim-think-response

Conversation

@xkam7ar

@xkam7ar xkam7ar commented Jul 14, 2026

Copy link
Copy Markdown

Closes #345.

Summary

Trim the response again after removing a complete <think>...</think> block. This lets the existing Markdown-fence cleanup recognize JSON fences exposed behind leading whitespace.

The correction affects the shared response normalizer used by resume evaluation, project generation, and PDF section extraction.

Regression coverage

The new standard-library test covers:

  • plain JSON
  • directly fenced JSON
  • a think block followed by fenced JSON

The third case raised JSONDecodeError before the one-line fix and passes afterward.

Validation

  • Focused regression: 1 passed
  • Full discovered local suite: 1 passed (the repository had no existing tests)
  • Black on both changed files: passed
  • Python AST validation: 12/12 passed
  • git diff --check: passed

Real-provider and PDF pipeline smoke checks were not run because they require external models, documents, or credentials. No prompt, provider, dependency, API, or configuration behavior changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Fenced JSON parsing fails after think blocks

1 participant