diff --git a/job_applier.mjs b/job_applier.mjs index 6f69ff2..72445d2 100644 --- a/job_applier.mjs +++ b/job_applier.mjs @@ -195,7 +195,8 @@ async function handleResult(job, result, results, settings, profile, apiKey) { case 'needs_answer': { const questionText = pending_question?.label || pending_question || 'Unknown question'; - console.log(` 💬 Unknown question — asking Claude: "${questionText}"`); + const questionOptions = pending_question?.options || []; + console.log(` 💬 Unknown question — asking Claude: "${questionText}"${questionOptions.length ? ` (options: ${questionOptions.join(', ')})` : ''}`); const aiAnswer = await generateAnswer(questionText, profile, apiKey, { title, company }); @@ -209,13 +210,14 @@ async function handleResult(job, result, results, settings, profile, apiKey) { `❓ *New question* — ${company} / ${title}`, ``, `*Question:* ${questionText}`, + questionOptions.length ? `*Options:* ${questionOptions.join(' | ')}` : '', ``, aiAnswer ? `*AI answer:*\n${aiAnswer}` : `_AI could not generate an answer._`, ``, `Reply with your answer to store it, or reply *ACCEPT* to use the AI answer.`, - ].join('\n'); + ].filter(Boolean).join('\n'); await sendTelegram(settings, msg); results.needs_answer++; diff --git a/lib/form_filler.mjs b/lib/form_filler.mjs index 538a854..39c1f75 100644 --- a/lib/form_filler.mjs +++ b/lib/form_filler.mjs @@ -306,8 +306,14 @@ export class FormFiller { } } } else if (await this.isRequired(sel)) { - // Non-EEO required select with no answer — report as unknown - unknown.push(lbl); + // Non-EEO required select with no answer — report as unknown with options + const opts = await sel.$$('option'); + const options = []; + for (const opt of opts) { + const text = (await opt.textContent().catch(() => '') || '').trim(); + if (text && !/^select/i.test(text)) options.push(text); + } + unknown.push({ label: lbl, type: 'select', options }); } } }