Skip to content

test: preserve loop claim tokens in daemon fixtures - #418

Merged
pedronauck merged 1 commit into
compozy:mainfrom
franciscpd:fix/loop-goal-fixture-claim-token
Aug 16, 2026
Merged

pedronauck merged 1 commit into
compozy:mainfrom
franciscpd:fix/loop-goal-fixture-claim-token

Conversation

@franciscpd

@franciscpd franciscpd commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Fixes #417.

The shared daemon integration fixture now retains the exact claim token returned for a Loop-bound task run and supplies it when starting that run. This restores the canonical Goal integration suite without weakening production claim-token validation or exposing the raw token.

Implemented with Codex and reviewed locally by Claude Fable. The resulting diff and verification evidence were independently checked before publication.

How you verified it

  • Confirmed the base branch RED: five TestLoopGoalManagedRuntimeIntegration cases failed with task: invalid claim token.
  • Confirmed the fixed suite GREEN: all eight Goal managed-runtime integration cases pass.
  • Passed the three neighboring daemon E2Es for ACP crash escalation, automation task delegation, and zero-network local execution.
  • Passed the Compozy test-convention checker and the focused integration suite under -race.
  • Passed scoped Go lint with zero issues.
  • Passed make gate-full: 22,534 tests, 3 expected skips, zero failures; build and package boundaries passed. The command used a process-local tag.gpgSign=false override because the operator's global Git configuration signs tags used by release fixtures.
  • Claude Fable verdict: APPROVED, with no blocking findings.

Impact

Test infrastructure only. No CLI command, HTTP/UDS route, config.toml key, native tool, extension/hook surface, workspace data path, Web surface, public documentation, or official Compozy skill changes.


  • make gate passes locally (make gate-full before review on larger changes)
  • New or changed behavior is covered by tests, or I explained above why not
  • If an agent wrote or co-wrote this, I named it above and verified the result myself

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of loop-run lifecycle transitions by preserving the lease claim token during fixture-based runs.
    • Direct daemon runs continue to operate without a claim token.

@franciscpd
franciscpd requested a review from pedronauck as a code owner August 16, 2026 13:02
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

@franciscpd is attempting to deploy a commit to the Compozy Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 16, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a7432f30-8c9f-4cdb-8534-2ae41cf6b069

📥 Commits

Reviewing files that changed from the base of the PR and between 17f70f9 and 8aecb28.

📒 Files selected for processing (1)
  • internal/daemon/task_run_fixture_integration_test.go

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.


Walkthrough

The daemon integration fixture now stores the lease claim token returned by ClaimNextRun and passes it to StartRun for loop-bound runs. Direct daemon runs continue to use an empty token.

Changes

Daemon fixture lifecycle

Layer / File(s) Summary
Preserve and forward claim token
internal/daemon/task_run_fixture_integration_test.go
The fixture stores the token from ClaimNextRun and passes it to StartRun for claimed runs. Direct runs remain tokenless.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 8aecb

This localized test-fixture change preserves Loop claim tokens without altering production behavior or validation, and no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

  • compozy/compozy#407: Modifies related daemon loop lifecycle handling and lease-token propagation in integration tests.

Suggested reviewers: pedronauck

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change forwards loop claim tokens and preserves direct runs, but it does not add the required regression coverage described in issue #417. Add a regression test that verifies a claimed run cannot start when its claim token is dropped or replaced.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: preserving loop claim tokens in daemon test fixtures.
Out of Scope Changes check ✅ Passed The changes are limited to the daemon integration fixture and directly support the requirements in issue #417.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

Greptile Summary

The PR fixes the shared daemon integration fixture so Loop-bound task runs retain the claim token returned by the claim operation and provide it when starting the same run.

  • Captures the claim token after claiming a Loop-bound run.
  • Passes that token through the existing StartRun request.
  • Leaves non-Loop fixture behavior unchanged.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable defects identified in the test-fixture change.

The captured token is overwritten on transaction retries and therefore matches the committed claim, while non-Loop runs continue to pass the same empty token value as before.

Important Files Changed

Filename Overview
internal/daemon/task_run_fixture_integration_test.go Correctly preserves the committed Loop claim token across the fixture lifecycle without weakening production validation or changing non-Loop behavior.

Reviews (1): Last reviewed commit: "test: preserve loop claim tokens in daem..." | Re-trigger Greptile

@pedronauck
pedronauck merged commit e3a6532 into compozy:main Aug 16, 2026
28 of 31 checks passed
This was referenced Aug 24, 2026
This was referenced Sep 1, 2026
This was referenced Sep 27, 2026
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.

[Loops] Loop Goal integration fixtures discard required task claim tokens

2 participants