Skip to content

fix(company-os): dispatch gate follow-ups: an unknown owner gets 404, and a blocked rate-limited run stays deferred (#20308) - #20462

Closed
mrveiss wants to merge 2 commits into
mainfrom
issue-20308-gate-followups
Closed

mrveiss wants to merge 2 commits into
mainfrom
issue-20308-gate-followups

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Closes #20308

Thinking Path

Three small follow-ups from the review of #19958.

What Changed

  • llc/api/agents.py: when ownership can't be shown (both company ids None, or a caller with no org), the route answers 404, not 409. A 409 states the block reason, and would tell an unknown tenant the agent exists. In production require_org_context already refuses a caller with no org, so this is defensive.
  • test_handle_due_agent_defers_a_blocked_agent_and_leaves_its_rate_limited_run: new.
  • test_provider_rate_limit_recovery.py: six inert dispatch_block_reason stubs and their wrong comment removed from the _handle_rate_limited tests.

Verification

  • llc/tests, whole: 2586 passed, 2 skipped.
  • With the route fix reverted, its test fails with assert 409 == 404.

Not established:

  • The new deferred test hasn't been shown failing against a scheduler with no gate.
  • The six stubs were removed together, not one at a time; the file's 12 tests pass.

Model Used

Claude Sonnet 5 for implementation, Claude Opus 5.5 for direction

🤖 Generated with Claude Code

@mrveiss mrveiss added this to the M2 - Company OS workflow-ready milestone Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next included review available in 3 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0dbb02f and 19176f2.

Files selected for processing: 3
  • autobot-backend/llc/api/agents.py
  • autobot-backend/llc/tests/test_dispatch_gate_19240.py
  • autobot-backend/llc/tests/test_provider_rate_limit_recovery.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20462 (head 234b2ed): approve. Read directly: a refused trigger gives no reason unless the caller is proven to own the agent, so None with None is 404. Tests cover it and a blocked agent with a rate-limited run; the inert stubs are gone.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Landed via the merge train (PR #20500), main 64943e3.

@mrveiss mrveiss closed this Nov 1, 2026
@mrveiss
mrveiss deleted the issue-20308-gate-followups branch November 1, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M2.6 Budgets enforced and costs recorded

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(company-os): dispatch gate follow-ups: a companyless agent's 409 and a blocked rate-limited run

1 participant