(MOT-3748) fix(harness): preserve registrations across engine reloads - #666
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe PR adds reusable Harness quickstart workflow inputs and secrets, connects eligible releases to Harness smoke testing, updates Harness dependencies, and adds queue provisioning fallback for engines that reject restart-redelivery configuration. ChangesHarness release and runtime compatibility
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseSetup
participant RegistryPublication
participant HarnessQuickstart
ReleaseSetup->>ReleaseSetup: Detect Harness worker or dependency
ReleaseSetup->>RegistryPublication: Publish release
RegistryPublication->>HarnessQuickstart: Invoke quickstart with channel
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
skill-check — worker0 verified, 51 skipped (no docs/).
Four for four. Nicely done. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 283-286: Update the reusable workflow invocation of
harness-quickstart.yml to replace secrets: inherit with an explicit secrets
mapping containing only SLACK_BOT_TOKEN and ZAI_API_KEY, preserving the existing
channel input.
In `@harness/src/queue.rs`:
- Around line 46-55: Update ensure_turn_queue around the bounded primary retry
loop so a legacy schema fallback triggered by is_legacy_queue_schema_error can
perform its own retry even when the primary DEFINE_ATTEMPTS budget is exhausted.
Ensure legacy_turn_queue_definition() is actually submitted before returning the
error, and add a regression test covering the schema error on the final primary
attempt and successful fallback provisioning.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4fa84a8e-eb0b-41ef-96d6-64bd116f0b52
⛔ Files ignored due to path filters (1)
harness/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (8)
.github/workflows/harness-quickstart.yml.github/workflows/release.ymlharness/Cargo.tomlharness/iii.worker.yamlharness/src/queue.rsharness/tests/e2e/Cargo.tomlharness/tests/integration/Cargo.tomlharness/tests/manifest.rs
| uses: ./.github/workflows/harness-quickstart.yml | ||
| with: | ||
| channel: ${{ needs.setup.outputs.registry_tag }} | ||
| secrets: inherit |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Pass only the declared secrets to the reusable workflow.
secrets: inherit exposes every secret available to the release job. The quickstart contract requires only SLACK_BOT_TOKEN and ZAI_API_KEY. Pass those names explicitly.
Proposed fix
with:
channel: ${{ needs.setup.outputs.registry_tag }}
- secrets: inherit
+ secrets:
+ SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
+ ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| uses: ./.github/workflows/harness-quickstart.yml | |
| with: | |
| channel: ${{ needs.setup.outputs.registry_tag }} | |
| secrets: inherit | |
| uses: ./.github/workflows/harness-quickstart.yml | |
| with: | |
| channel: ${{ needs.setup.outputs.registry_tag }} | |
| secrets: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
| ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }} |
🧰 Tools
🪛 zizmor (1.28.0)
[warning] 283-283: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow
(secrets-inherit)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/release.yml around lines 283 - 286, Update the reusable
workflow invocation of harness-quickstart.yml to replace secrets: inherit with
an explicit secrets mapping containing only SLACK_BOT_TOKEN and ZAI_API_KEY,
preserving the existing channel input.
Source: Linters/SAST tools
| if restart_redelivery_requested && is_legacy_queue_schema_error(&last_error) { | ||
| tracing::warn!( | ||
| queue = TURN_QUEUE, | ||
| error = %last_error, | ||
| "queue worker does not support restart redelivery; retrying with the legacy queue schema" | ||
| ); | ||
| payload = legacy_turn_queue_definition(); | ||
| restart_redelivery_requested = false; | ||
| continue; | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Allow the fallback to consume a retry after the primary budget is exhausted.
If the unsupported-field error occurs on the final DEFINE_ATTEMPTS iteration, this branch changes payload and executes continue, but the bounded loop has no next iteration. ensure_turn_queue then returns the schema error without sending legacy_turn_queue_definition().
The supplied harness/src/main.rs flow waits for queue provisioning before it announces readiness. Give the legacy fallback its own retry budget, and add a regression test that returns the schema error on the final primary attempt.
Also applies to: 132-162
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@harness/src/queue.rs` around lines 46 - 55, Update ensure_turn_queue around
the bounded primary retry loop so a legacy schema fallback triggered by
is_legacy_queue_schema_error can perform its own retry even when the primary
DEFINE_ATTEMPTS budget is exhausted. Ensure legacy_turn_queue_definition() is
actually submitted before returning the error, and add a regression test
covering the schema error on the final primary attempt and successful fallback
provisioning.
Published Harness workers can lose their registered functions when the engine reloads another worker, causing calls to fail with
function_not_found. The same release also had a startup incompatibility: its queue recovery option was sent to older published queue workers, so Harness exited during installation.Technical details
iii-sdk/iii-helpers0.21.8release.queue ^0.21.2.redeliver_on_engine_restartwhen an older queue worker rejects that field, preserving startup compatibility while the queue upgrade is rolled out.1.6.7.Fixes MOT-3748
Summary by CodeRabbit
New Features
Bug Fixes
Chores