Skip to content

fix(agent): prefer the terminal-run rejection slug over its English detail - #4299

Merged
kojiwakayama merged 2 commits into
mainfrom
fix/757-terminal-append-slug
Aug 29, 2026
Merged

kojiwakayama merged 2 commits into
mainfrom
fix/757-terminal-append-slug

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Refs https://github.com/veryfront/veryfront-issue-inbox/issues/757

The runtime half of #757, shippable independently: isTerminalRunConversationRunAppendError and isIgnorableConversationRunAppendError now share one predicate that prefers slug === "terminal-run-append-rejected" (the identifier the issue's final analysis settled on — same pattern the 404 deleted-run branch already uses) and keeps the exact-detail match as a fallback. Until the veryfront-api change registers the slug, the new branch never matches and behavior is byte-identical; after it, a reworded detail no longer degrades the terminal classification to retries.

Deploy-order safe by construction — this is the "runtime prefers the slug, string as fallback" step the issue prescribes, and it works correctly both before and after the api-side registration (which lives in veryfront-api and is not part of this PR; noted on the issue).

Red → green: new test constructs a 400 with the distinct slug and a reworded detail (predicates must classify terminal by slug alone — red before: both returned false) and a 400 with only validation-failed + reworded detail (must miss, never misfire — green both before and after). durable-append-errors.test.ts 5 steps and consumer suite durable.test.ts 50 steps pass, exit 0; fmt/lint/check clean.

…etail

The terminal-run append rejection was distinguishable only by exact string
equality on a human-readable message; rewording it in the api makes the
predicate miss and the runtime fall back to noisy retries. The wire schema
already parses a slug and the 404 deleted-run branch already matches on
one, so the 400 branch now prefers the api's registered
terminal-run-append-rejected slug, keeping the string as fallback until
every api deployment emits it.

Safe to ship before the api change: the slug simply never matches until
the api registers it, and the fallback preserves today's behavior. The
misfire hazard stays covered -- a reworded detail without the distinct
slug still misses rather than misclassifying a replay-checkpoint mismatch
as terminal.

Refs veryfront/veryfront-issue-inbox#757

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kojiwakayama has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 20 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a3ba81bf-c6c3-475f-9a9b-6110d89c3b1d

📥 Commits

Reviewing files that changed from the base of the PR and between aa69b39 and 7cb8395.

📒 Files selected for processing (3)
  • docs/api-reference/veryfront/agent.md
  • src/agent/conversation/durable-append-errors.test.ts
  • src/agent/conversation/durable-append-errors.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@kojiwakayama
kojiwakayama enabled auto-merge August 29, 2026 05:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-08-29T06:17:31.594646Z 7cb8395 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gitar-bot

gitar-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime.
Learn more

Code Review ✅ Approved

Updates terminal-run rejection classification to prefer the terminal-run-append-rejected slug over the English detail message, with exact-detail match as fallback. This ensures consistent terminal classification even if the detail text is reworded, and is deploy-order safe — behavior remains unchanged until the API registers the slug. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

Copy link
Copy Markdown

📦 Client bundle boundary

Entrypoint Modules Source size Server leaks
src/index.client.ts 287 2217 KiB ✅ 0

A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in scripts/lint/client-bundle-baseline.json to burn down.

Copy link
Copy Markdown
Contributor

Score: 93/100 — excellent. Small, correct, well-tested fix that follows the existing pattern in this file exactly.

  • Correctness: isTerminalRunAppendRejection widens the 400 match from exact-detail to slug === "terminal-run-append-rejected" || detail === TERMINAL_RUN_APPEND_REJECTION_DETAIL — a strict superset of the old condition, so it's provably non-regressive, and it mirrors the 404 branch's existing slug-based match (DELETED_RUN_APPEND_REJECTION_DETAIL) instead of inventing a new idiom.
  • Test coverage: the new case directly targets the misfire hazard — a reworded detail with the new slug must still classify terminal, and a reworded detail without it (different slug) must still miss rather than misclassify. That's exactly the red/green pair this change needs.
  • Deploy-order safety: correctly argued and structurally true — the slug branch is inert until the API starts emitting it, so this ships ahead of the API-side change with byte-identical current behavior.
  • Documentation: PR description, inline comments, and commit message are all consistent with the diff and explain why, not just what — good trail back to issue [Aikido] AI Fix for 3rd party Github Actions should be pinned #757.
  • Minor nit (non-blocking): isTerminalRunAppendRejection re-checks status === 400 even when called from isIgnorableConversationRunAppendError, which already guards on that status a few lines up — harmless duplication, but could be trimmed if the helper is only ever called from 400-guarded contexts.

Nothing here blocks merge; the branch shows as blocked, presumably on review/approval rather than a code issue.


Generated by Claude Code

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kojiwakayama has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 7cb8395b67

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@sonarqubecloud

Copy link
Copy Markdown

@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 29, 2026
Merged via the queue into main with commit 0820761 Aug 29, 2026
58 checks passed
@kojiwakayama
kojiwakayama deleted the fix/757-terminal-append-slug branch August 29, 2026 06:38
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.

2 participants