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 "ರಿಯಾಕ್ಟಿವ್ ರೆಸ್ಯೂಮ್‌ಗೆ ದೇಣಿಗೆ ನೀಡಿ"
#: 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 "pipeline-flow.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 "ಮರು ಅಂಕೀಕರಿಸಿ"
@@ -3546,10 +3590,18 @@ msgstr "ಪ್ರತಿಕ್ರಿಯಾತ್ಮಕ ಪುನರಾರಂಭ v
msgid "Reactive Resume v4 (JSON)"
msgstr "ರಿಯಾಕ್ಟಿವ್ ರೆಸ್ಯೂಮೇ 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 "ಜೂಲೂ"