Skip to content

fix(agent): keep delayed Slack receipts retryable#1352

Merged
khaliqgant merged 4 commits into
mainfrom
fix/feature-guardian-write-receipt-20260722
Jul 22, 2026
Merged

fix(agent): keep delayed Slack receipts retryable#1352
khaliqgant merged 4 commits into
mainfrom
fix/feature-guardian-write-receipt-20260722

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • treat a successful Relayfile write with no provider timestamp as receipt-pending, not a terminal handler failure
  • leave the progress checkpoint unchanged so the next tick replays the existing stable idempotency key
  • cover late receipt replay and assert a single provider-side create in the idempotent transport

Root cause

The write helper can return after the draft is admitted but before the provider receipt is visible. The guardian previously translated that success-without-receipt state into Slack post failed: no timestamp returned for feature capabilities-register, even though provider completion could still arrive later.

Relayfile v0.10.36 fixes one underlying accepted-operation 404 receipt visibility defect, but it is not deployed to the running snapshot and it does not remove the helper independent 15-second receipt deadline. This PR fixes the residual agent-side classification bug.

Red / green

Exact acceptance red, observed Node v20.20.1: with the production no-timestamp branch restored and the final fixture, 1 failed / 33 passed; exact cause Slack post failed: no timestamp returned for feature capabilities-register at agent.ts:796.

CI-correct local verification at 9f16f23, observed Node v22.14.0 / npm 10.9.2 as pinned by .github/workflows/test.yml:

  • npx vitest run .agentworkforce/agents/relay-feature-guardian/agent.test.ts: 34 passed
  • npm run typecheck: passed

The clean install reports existing transitive engine warnings for dependencies requiring newer Node 22 minors than the workflow pin; install and both gates pass. No live agent run, deploy, merge, or production mutation was performed.

@khaliqgant
khaliqgant requested a review from willwashburn as a code owner July 22, 2026 15:13
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba544d1a-90e6-4c62-a60f-5ff3b92eb77c

📥 Commits

Reviewing files that changed from the base of the PR and between 9f16f23 and e8fd8a7.

📒 Files selected for processing (3)
  • .agentworkforce/agents/relay-feature-guardian/agent.test.ts
  • .agentworkforce/agents/relay-feature-guardian/agent.ts
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • .agentworkforce/agents/relay-feature-guardian/agent.ts
  • .agentworkforce/agents/relay-feature-guardian/agent.test.ts

📝 Walkthrough

Walkthrough

The guardian now treats missing Slack receipt timestamps as pending, logs a warning, and retries on a later tick. Tests simulate delayed receipts and verify idempotent replay without duplicate Slack posts. The changelog documents the behavior.

Changes

Slack receipt retry flow

Layer / File(s) Summary
Pending receipt control flow
.agentworkforce/agents/relay-feature-guardian/agent.ts, CHANGELOG.md
Missing Slack timestamps log post-receipt-pending and return without advancing completion state; the changelog records the retry behavior.
Delayed receipt validation
.agentworkforce/agents/relay-feature-guardian/agent.test.ts
Tests simulate a first-write receipt delay, verify retry progression and matching payloads, and ensure only one provider post is created.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: willwashburn

Poem

I’m a rabbit with receipts in flight,
A missing timestamp waits till right.
I warn, I wait, then hop once more,
The same key keeps duplicates from the door.
One Slack post completes the night!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: delayed Slack receipts are now kept retryable instead of failing.
Description check ✅ Passed The description covers the summary and test evidence, with only the template's exact Test Plan and Screenshots sections missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/feature-guardian-write-receipt-20260722

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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 chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d519d4325e

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +799 to +804
ctx.log('warn', 'relay-feature-guardian.post-receipt-pending', {
channel,
feature: feature.id,
path: result.path,
});
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add an Unreleased entry for altered guardian delivery semantics

This changes the deployed guardian’s observable behavior from failing a run when no provider timestamp is returned to recording a successful, retry-pending run; the current [Unreleased - Patch] section does not describe that change. Add a concise Fixed entry so operators can understand why failed-run alerts may instead appear as receipt-pending warnings.

AGENTS.md reference: AGENTS.md:L29-L34

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in 352b226: added a concise Unreleased/Fixed entry describing the retry-pending receipt behavior and the preserved checkpoint/idempotency key.

@miyaontherelay
miyaontherelay force-pushed the fix/feature-guardian-write-receipt-20260722 branch from 352b226 to e8fd8a7 Compare July 22, 2026 20:21
@khaliqgant
khaliqgant merged commit d90ef2c into main Jul 22, 2026
32 checks passed
@khaliqgant
khaliqgant deleted the fix/feature-guardian-write-receipt-20260722 branch July 22, 2026 20:33
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