feat(agent): adopt AI SDK v7 — crash safety, context pruning, HITL approvals (#3362)

* docs(adr): propose agent AI SDK v7 adoption plan

* fix(ai): bind analyzeResume through aiService in service test

The test destructured analyzeResume as a named export that does not exist; main was red.

* test(agent): keep pure ai helpers real via spread-actual mock factory

* feat(agent): add run guards, patch version guard, run wall-clock timeout

* feat(agent): validate UI messages at the send boundary

* feat(agent): crash-safe draft-row persistence and server-side cancellation

* feat(agent): reap stale run claims at boot, on send, and on thread open

* feat(agent): fresh-document patch output and tiered context pruning

* feat(ai): shared agent tool contracts and message metadata schema

* feat(agent): add per-thread review-patches setting with update endpoint

* feat(agent): gate resume patches behind hmac-signed tool approval

* feat(agent): merge question answers and approval decisions before run claim

* feat(agent): approval ui with composed auto-send and fixture-driven tests

* feat(agent): usage metadata, tool activity cards, smoother streaming

* feat(agent): tool-call repair, input examples, structured step logging

* chore(i18n): translate new agent workspace strings across all locales

* fix(agent): gate stale-run draft cancellation on winning the claim clear

Snapshot streaming drafts before the conditional clear and skip the flip entirely when another reaper or a replacement run already cleared the claim. Also address review nits in eleven locale catalogs.

* fix(agent): flip reaped drafts only when their snapshotted state is unchanged

* fix(agent): address review findings across run lifecycle, context budget, and approval flow

- bind patches to the revision the model read via signed baseUpdatedAt
- claim the run before consuming a continuation; recorded-but-unexecuted approvals retry as pending continuations
- keep run ownership on stop() until cancellation persists; preserve the claim for the reaper when final persistence fails
- estimate tokens without serializing binary attachments (tokenx) and enforce the budget by dropping oldest whole turns
- mark crash-recovered patch results as snapshot boundaries; strip /data prefixes at execution time
- retry failed continuations without regenerate; mount a single AgentChat; disable response controls on read-only threads; freeze review toggle during runs (client+server)
- accumulate usage across continuations and match the SDK's nested usage shape; label-form token strings; reorderable source label; accessible note field; state-neutral web-search label

* chore(i18n): translate revised agent strings across all locales

* fix(agent): harden baseUpdatedAt validation and address review follow-ups

- bundle tokenx in the server runtime dependencies (e2e boot failure)
- strict ISO schema for baseUpdatedAt plus loud executor rejection of unparseable values
- it-IT source label consistency (Fonte)
- prove penultimate-turn retention in the context pruning test

* chore(deps): exempt tokenx from knip for the externalized server bundle
This commit is contained in:
Amruth Pillai
2026-08-20 08:06:53 +02:00
committed by GitHub
parent dbbab6fd76
commit c8081ac2fe
95 changed files with 14919 additions and 497 deletions
+103 -3
View File
@@ -543,6 +543,14 @@ msgstr "ଆବେଦନ କରାଯାଇଛି"
msgid "Applied on"
msgstr "ପ୍ରୟୋଗ ହୋଇଛି |"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Approve"
msgstr "ଅନୁମୋଦନ କରନ୍ତୁ"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Approved — waiting for the agent…"
msgstr "ଅନୁମୋଦିତ — ଏଜେଣ୍ଟଙ୍କୁ ଅପେକ୍ଷା କରୁଛି…"
#: src/libs/locale.ts
msgid "Arabic"
msgstr "ଆରବୀ"
@@ -1462,6 +1470,14 @@ msgstr "ଆପଣଙ୍କ API କି ବିଲୋପ ହେଉଛି..."
msgid "Deleting your resume..."
msgstr "ଆପଣଙ୍କ ରେଜ୍ୟୁମେ ବିଲୋପ ହୋଇଯାଉଛି..."
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Denied — waiting for the agent…"
msgstr "ଅସ୍ୱୀକୃତ — ଏଜେଣ୍ଟଙ୍କୁ ଅପେକ୍ଷା କରୁଛି…"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Deny"
msgstr "ଅସ୍ୱୀକାର କରନ୍ତୁ"
#: src/libs/resume/ats.ts
msgid "Describe what you did so the entry contributes keywords for matching."
msgstr "ମେଳ କରିବା ପାଇଁ ଏଣ୍ଟ୍ରିରେ କୀୱାର୍ଡ ଯୋଗ ହେବା ଭଳି ଆପଣ କଣ କରିଥିଲେ ଲେଖନ୍ତୁ।"
@@ -1530,6 +1546,10 @@ msgstr "ଦାନ କରନ୍ତୁ"
msgid "Donate to Reactive Resume"
msgstr "Reactive Resume କୁ ଦାନ କରନ୍ତୁ"
#: src/routes/agent/-components/tool-part-card.tsx
msgid "Done"
msgstr "ସମ୍ପୂର୍ଣ୍ଣ ହୋଇଛି"
#. Action button to download two-factor backup codes as a text file
#. Primary action in the builder header to open resume download options
#: src/dialogs/auth/enable-two-factor.tsx
@@ -1642,6 +1662,10 @@ msgstr "ପୂର୍ଣ୍ଣପର୍ଦ୍ଦା ମୋଡ୍‌ରେ ବି
msgid "Edit date"
msgstr "ତାରିଖ ସମ୍ପାଦନ କରନ୍ତୁ"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Edit declined"
msgstr "ସମ୍ପାଦନ ଅସ୍ୱୀକୃତ ହୋଇଛି"
#. Resume card context menu action to edit resume metadata
#. Resume card dropdown action to edit resume metadata
#: src/routes/builder/$resumeId/-components/header.tsx
@@ -1837,6 +1861,10 @@ msgstr "ଅପେକ୍ଷା କିମ୍ବା ବିଳମ୍ବ ନକରି
msgid "Exported pipeline-flow.png"
msgstr "ରପ୍ତାନି ହୋଇଥିବା ପାଇପଲାଇନ-ପ୍ରବାହ। png |"
#: src/routes/agent/-components/tool-part-card.tsx
msgid "Failed"
msgstr "ବିଫଳ ହୋଇଛି"
#: src/routes/builder/$resumeId/-sidebar/right/sections/resume-analysis.tsx
msgid "Failed to analyze resume."
msgstr "ରେଜ୍ୟୁମେ ବିଶ୍ଳେଷଣ କରିବାରେ ବିଫଳ ହେଲା।"
@@ -1967,6 +1995,10 @@ msgstr "ପ୍ରଦାନକାରୀକୁ ଅନଲିଙ୍କ କରିବ
msgid "Failed to update provider."
msgstr "ପ୍ରଦାତାଙ୍କୁ ଅପଡେଟ୍ କରିବାରେ ବିଫଳ ହୋଇଛି।"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Failed to update thread settings."
msgstr "ଥ୍ରେଡ୍ ସେଟିଂଗୁଡ଼ିକ ଅପଡେଟ୍ କରିବାରେ ବିଫଳ ହେଲା।"
#. Fallback toast when changing account password fails
#: src/dialogs/auth/change-password.tsx
msgid "Failed to update your password. Please try again."
@@ -3153,6 +3185,14 @@ msgstr "OpenRouter"
msgid "opens in new tab"
msgstr "ନୂତନ ଟାବ୍‌ରେ ଖୋଲେ"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Optional note for the agent"
msgstr "ଏଜେଣ୍ଟଙ୍କ ପାଇଁ ଇଚ୍ଛାଧୀନ ଟିପ୍ପଣୀ"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Optional note for the agent…"
msgstr "ଏଜେଣ୍ଟଙ୍କ ପାଇଁ ଇଚ୍ଛାଧୀନ ଟିପ୍ପଣୀ…"
#: src/routes/builder/$resumeId/-sidebar/right/sections/sharing.tsx
msgid "Optionally, set a password so that only people with the password can view your resume through the link."
msgstr "ଇଚ୍ଛାକୃତ ଭାବେ, ଏକ ପାସୱାର୍ଡ ସେଟ୍ କରନ୍ତୁ ଯାହାଦ୍ୱାରା କେବଳ ପାସୱାର୍ଡ ଥିବା ଲୋକମାନେ ଲିଙ୍କ ମାଧ୍ୟମରେ ଆପଣଙ୍କ ରେଜ୍ୟୁମେ ଦେଖିପାରିବେ।"
@@ -3499,6 +3539,10 @@ msgstr "ପ୍ରକାଶନଗୁଡିକ"
msgid "Publisher"
msgstr "ପ୍ରକାଶକ"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Raw JSON"
msgstr "କଞ୍ଚା JSON"
#: src/features/applications/components/application-ai-copilot.tsx
msgid "Re-score"
msgstr "ପୁନ score ସ୍କୋର କରନ୍ତୁ |"
@@ -3546,10 +3590,18 @@ msgstr "ପ୍ରତିକ୍ରିୟାଶୀଳ ରିଜ୍ୟୁମ୍ v<0>
msgid "Reactive Resume v4 (JSON)"
msgstr "Reactive Resume v4 (JSON)"
#: src/routes/agent/-components/tool-part-card.tsx
msgid "Read an attachment"
msgstr "ଗୋଟିଏ ଆଟାଚମେଣ୍ଟ୍ ପଢ଼ାଗଲା"
#: src/features/resume/stylesheet/editor.tsx
msgid "Read the Applying Custom Styles guide."
msgstr "କଷ୍ଟମ୍ ଷ୍ଟାଇଲ୍ସ ପ୍ରୟୋଗ କରିବା ଗାଇଡ୍ ପଢ଼ନ୍ତୁ।"
#: src/routes/agent/-components/tool-part-card.tsx
msgid "Read the resume"
msgstr "ରେଜ୍ୟୁମେ ପଢ଼ାଗଲା"
#: src/features/applications/components/application-form-sheet.tsx
msgid "Reading the posting…"
msgstr "ପୋଷ୍ଟିଂ ପଢ଼ାଯାଉଛି…"
@@ -3700,8 +3752,8 @@ msgid "Restore"
msgstr "ପୁନଃସ୍ଥାପନ କରନ୍ତୁ"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Restore the resume to before this patch? This will roll back this patch and any patches applied after it."
msgstr "ଏହି ପ୍ୟାଚ୍ ପୂର୍ବରୁ ଥିବାିଜ୍ୟୁମ ପୁନଃସ୍ଥାପିତ କରିବେ କି? ଏହା ଏହି ପ୍ୟାଚ୍ ଏବଂ ଏହା ପରେ ଲାଗୁ ହୋଇଥିବା ଯେକୌଣସି ପ୍ୟାଚ୍‌କୁ ରୋଲ୍‌ବ୍ୟାକ୍ କରିବ।"
msgid "Restore the resume to before this patch?"
msgstr "ଏହି ପ୍ୟାଚ୍ ପୂର୍ବର ଅବସ୍ଥାକୁ ରଜ୍ୟୁମ ପୁନଃସ୍ଥାପ କରିବେ କି?"
#: src/routes/builder/$resumeId/-components/version-history.tsx
msgid "Restore this version?"
@@ -3726,6 +3778,10 @@ msgstr "ରେଜ୍ୟୁମେ ବିଶ୍ଳେଷଣ ସମ୍ପୂର୍
msgid "Resume content"
msgstr "ବିଷୟବସ୍ତୁକୁ ପୁଣି ଆରମ୍ଭ କରନ୍ତୁ"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Resume edit"
msgstr "ରେଜ୍ୟୁମେ ସମ୍ପାଦନ"
#: src/features/applications/components/application-detail-sheet.tsx
msgid "Resume file"
msgstr "ରେଜୁମେ ଫାଇଲ୍"
@@ -3754,10 +3810,18 @@ msgstr "ରେଜ୍ୟୁମେଗୁଡିକ"
msgid "Retry"
msgstr "ପୁନଃଚେଷ୍ଟା କରନ୍ତୁ"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Review edits"
msgstr "ସମ୍ପାଦନଗୁଡ଼ିକର ସମୀକ୍ଷା କରନ୍ତୁ"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Review the resume against a job description and ask me questions before changing uncertain sections."
msgstr "ଚାକିରି ବର୍ଣ୍ଣନା ସହିତ ଜୀବନ ଜୀବିକା ସମୀକ୍ଷା କରନ୍ତୁ ଏବଂ ଅନିଶ୍ଚିତ ବିଭାଗ ପରିବର୍ତ୍ତନ କରିବା ପୂର୍ବରୁ ମୋତେ ପ୍ରଶ୍ନ ପଚାରନ୍ତୁ।"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Review this edit"
msgstr "ଏହି ସମ୍ପାଦନର ସମୀକ୍ଷା କରନ୍ତୁ"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Rework the summary so it targets a senior engineering manager role without sounding generic."
msgstr "ସାଧାରଣ ଶବ୍ଦ ନ ଶୁଣାଇ ଜଣେ ବରିଷ୍ଠ ଇଞ୍ଜିନିୟରିଂ ପରିଚାଳକ ଭୂମିକାକୁ ଲକ୍ଷ୍ୟ କରି ସାରାଂଶକୁ ପୁନଃନିର୍ମାଣ କରନ୍ତୁ।"
@@ -3798,6 +3862,10 @@ msgstr "ଘୁର୍ଣ୍ଣନ"
msgid "Run your first analysis to get a scorecard, strengths, and prioritized suggestions."
msgstr "ସ୍କୋରକାର୍ଡ, ଶକ୍ତି ଏବଂ ପ୍ରାଥମିକତାଭିତ୍ତିକ ପରାମର୍ଶ ପାଇବା ପାଇଁ ଆପଣଙ୍କ ପ୍ରଥମ ବିଶ୍ଳେଷଣ ଚଲାନ୍ତୁ।"
#: src/routes/agent/-components/tool-part-card.tsx
msgid "Running…"
msgstr "ଚାଲୁଛି…"
#: src/libs/locale.ts
msgid "Russian"
msgstr "ରୁଷିଆନ୍"
@@ -4253,6 +4321,15 @@ msgstr "ଉତ୍ସ"
msgid "Source Code"
msgstr "ସୋର୍ସ କୋଡ୍"
#. placeholder {0}: operation.from
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "Source: {0}"
msgstr "ଉତ୍ସ: {0}"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Sources"
msgstr "ଉତ୍ସଗୁଡ଼ିକ"
#: src/routes/builder/$resumeId/-sidebar/right/sections/page.tsx
msgid "Spacing (Horizontal)"
msgstr "ଅନୁପ୍ରାସ୍ଥିତ ଭାବେ ଖାଲି ସ୍ଥାନ"
@@ -4604,6 +4681,10 @@ msgstr "ଏହି ସହାୟକକୁ ଖୋଲାଯାଇପାରିଲା
msgid "This date will not be read correctly."
msgstr "ଏହି ତାରିଖକୁ ଠିକ୍‌ଭାବେ ପଢ଼ାଯିବ ନାହିଁ।"
#: src/routes/agent/-components/patch-approval-card.tsx
msgid "This edit request can no longer be answered."
msgstr "ଏହି ସମ୍ପାଦନା ଅନୁରୋଧର ଆଉ ଉତ୍ତର ଦିଆଯାଇପାରିବ ନାହିଁ।"
#: src/libs/resume/ats.ts
msgid "This email address will not be recognized."
msgstr "ଏହି ଇମେଲ୍ ଠିକଣାକୁ ଚିହ୍ନଟ କରାଯିବ ନାହିଁ।"
@@ -4712,6 +4793,10 @@ msgstr "ଯଦି ଆପଣ ଅନେକ ପାସକି ରଖିବାକୁ
msgid "This will remove all items from this section."
msgstr "ଏହା ଏହି ବିଭାଗରୁ ସମସ୍ତ ଆଇଟମ୍ କାଢିଦେବ।"
#: src/routes/agent/-components/agent-chat.tsx
msgid "This will roll back this patch and any patches applied after it."
msgstr "ଏହା ଏହି ପ୍ୟାଚ୍ ଏବଂ ଏହା ପରେ ଲାଗୁ କରାଯାଇଥିବା ସମସ୍ତ ପ୍ୟାଚ୍‌କୁ ପଛକୁ ଘୁଞ୍ଚାଇଦେବ।"
#: src/routes/agent/-components/agent-chat.tsx
#: src/routes/agent/-components/thread-sidebar.tsx
msgid "Thread actions"
@@ -4794,6 +4879,18 @@ msgstr "ଡାହାଣ ସାଇଡବାର୍ ଟୋଗଲ୍ କରନ୍ତ
msgid "Toggle threads"
msgstr "ଥ୍ରେଡଗୁଡ଼ିକୁ ଟୋଗଲ୍ କରନ୍ତୁ"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Tokens: {threadTokenTotal}"
msgstr "ଟୋକେନ୍: {threadTokenTotal}"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Tokens: {total}"
msgstr "ଟୋକେନ୍: {total}"
#: src/routes/agent/-components/agent-chat.tsx
msgid "Tokens: {total} ({cached} cached)"
msgstr "ଟୋକେନ୍: {total} ({cached} କ୍ୟାଶ୍ ହୋଇଛି)"
#: src/features/applications/components/application-form-sheet.tsx
msgid "Track a job you're applying to and link the resume you sent."
msgstr "ଆପଣ ଆବେଦନ କରୁଥିବା ଏକ କାର୍ଯ୍ୟକୁ ଟ୍ରାକ୍ କରନ୍ତୁ ଏବଂ ଆପଣ ପଠାଇଥିବା ରିଜ୍ୟୁମକୁ ଲିଙ୍କ୍ କରନ୍ତୁ |"
@@ -5213,6 +5310,10 @@ msgstr "ଆମେ ସ୍ଵଚାଳିତ ଭାବରେ ଫର୍ମାଟ୍
msgid "We couldn't find that page"
msgstr "ଆମେ ସେହି ପୃଷ୍ଠା ପାଇଲୁ ନାହିଁ।"
#: src/routes/agent/-components/tool-part-card.tsx
msgid "Web search"
msgstr "ୱେବ୍ ଖୋଜ"
#: src/dialogs/resume/sections/award.tsx
#: src/dialogs/resume/sections/certification.tsx
#: src/dialogs/resume/sections/education.tsx
@@ -5445,4 +5546,3 @@ msgstr "ଜୁମ୍ ଆଉଟ୍ କରନ୍ତୁ"
#: src/libs/locale.ts
msgid "Zulu"
msgstr "ଜୁଲୁ"