Skip to content

(MOT-4497) feat(fp,web,workflow,sandbox-code-runner,scrapling): opt-in guidance injection via configuration entries, hot-applied - #822

Merged
andersonleal merged 2 commits into
mainfrom
fix/token-usage-non-harness
Aug 18, 2026
Merged

(MOT-4497) feat(fp,web,workflow,sandbox-code-runner,scrapling): opt-in guidance injection via configuration entries, hot-applied#822
andersonleal merged 2 commits into
mainfrom
fix/token-usage-non-harness

Conversation

@andersonleal

Copy link
Copy Markdown
Collaborator

Non-harness half of the token-usage work: each worker's system-prompt usage guidance moves behind an inject_guidance knob (ON by default) in its builtin-configuration entry. Flipping it in the console (schema form) or via configuration::set binds/unbinds the worker's pre-generate hook live — no restart — cutting the injected guidance out of every generation when it isn't wanted.

What's here

  • crates/config-client — shared plumbing for the knob workers (fp, web, workflow, sandbox-code-runner; scrapling mirrors it in Python): retry ladder with a NOT_FOUND fast-path, seed-only-when-nothing-stored (configuration::register REPLACES the stored value whenever initial_value is supplied, so the pre-check is load-bearing), case-SENSITIVE NOT_FOUND so an absent config plane never reads as "nothing stored yet", serialized reloads (fetch inside the lock), and a post-bind boot refresh closing the fetch→bind gap.
  • Best-effort boot for all five: a configuration-worker failure warns and runs on defaults instead of taking the worker's real surface off the bus (docs/sops/configuration.md now documents the cosmetic-knob exception).
  • sandbox-code-runner: seeded_ids() reserves on-config-change + ui-content in the claims registry before any guest-facing surface is live, closing a boot window where a guest register_function could claim a late-registered worker id and abort the process via the SDK's duplicate-id panic. The dead custom config form (pre-dating the entry, showing stale timeout fields) is removed so the console's schema form renders the knob; README documents the entry.
  • fp: no injected UI for one boolean — the fp/ui package, build.rs, and src/ui.rs are gone; the schema form serves the knob.
  • llm-router: composite provider::model ids (the console display form) resolve consistently everywhere — catalog queries retry an exact miss via the split pair (supports delegates to get, so they can never disagree), and chat/route/count_tokens split known-provider composites before dispatch. Metadata and routing can no longer disagree about the same id.
  • Providers: llamacpp, github-copilot, kimi, and openrouter tag their router-ready handlers internal, keeping the default engine::functions::list free of provider plumbing.
  • Policy/manifests: !<worker>::on-config-change denies for all five workers (web and workflow were missing theirs too); configuration dependency declared in the fp / sandbox-code-runner / workflow / scrapling manifests.

Verification

Per-worker cargo fmt + clippy --all-features --all-targets clean and tests green: fp 58, sandbox-code-runner 175 (+ 275 ui vitest, clean tsc), web 102, workflow 137, llm-router 158 (incl. engine-backed integration), the three tagged providers, and the new crate. Scrapling: ruff clean, configuration/guidance suites pass (the rest of its suite needs the real scrapling/browser deps and is unchanged here). Rebased onto main over #812's provider-lifecycle hardening — the merged routing keeps both the availability semantics and the composite resolution, re-verified post-merge.

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview Aug 18, 2026 5:40pm
workers-tech-spec Ready Ready Preview Aug 18, 2026 5:40pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@andersonleal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 596acc7e-a493-4368-86c9-0a5364c6181b

📥 Commits

Reviewing files that changed from the base of the PR and between aaa7a1c and 75a2af4.

⛔ Files ignored due to path filters (6)
  • crates/config-client/Cargo.lock is excluded by !**/*.lock
  • crates/provider-integration-testkit/Cargo.lock is excluded by !**/*.lock
  • fp/Cargo.lock is excluded by !**/*.lock
  • sandbox-code-runner/Cargo.lock is excluded by !**/*.lock
  • web/Cargo.lock is excluded by !**/*.lock
  • workflow/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (58)
  • .github/scripts/tests/test_rust_ci_workflows.py
  • .github/workflows/rust-security-audit.yml
  • crates/config-client/Cargo.toml
  • crates/config-client/src/lib.rs
  • docs/sops/configuration.md
  • fp/Cargo.toml
  • fp/README.md
  • fp/iii-permissions.yaml
  • fp/iii.worker.yaml
  • fp/src/config.rs
  • fp/src/configuration.rs
  • fp/src/guidance.rs
  • fp/src/lib.rs
  • fp/src/main.rs
  • iii-permissions.yaml
  • llm-router/src/catalog/handlers.rs
  • llm-router/src/catalog/queries.rs
  • llm-router/src/chat/chat.rs
  • llm-router/src/count_tokens.rs
  • llm-router/src/routing.rs
  • llm-router/tests/integration.rs
  • provider-github-copilot/src/register.rs
  • provider-kimi/src/register.rs
  • provider-llamacpp/src/register.rs
  • provider-openrouter/src/register.rs
  • sandbox-code-runner/Cargo.toml
  • sandbox-code-runner/README.md
  • sandbox-code-runner/iii.worker.yaml
  • sandbox-code-runner/src/configuration.rs
  • sandbox-code-runner/src/functions/mod.rs
  • sandbox-code-runner/src/lib.rs
  • sandbox-code-runner/src/main.rs
  • sandbox-code-runner/src/ui.rs
  • sandbox-code-runner/ui/page.tsx
  • sandbox-code-runner/ui/src/page/ConfigForm.tsx
  • sandbox-code-runner/ui/src/page/index.ts
  • sandbox-code-runner/ui/src/styles/page.css
  • scrapling/README.md
  • scrapling/iii-permissions.yaml
  • scrapling/iii.worker.yaml
  • scrapling/src/configuration.py
  • scrapling/src/guidance.py
  • scrapling/src/main.py
  • scrapling/tests/test_configuration.py
  • scrapling/tests/test_guidance.py
  • web/Cargo.toml
  • web/README.md
  • web/src/config.rs
  • web/src/configuration.rs
  • web/src/main.rs
  • workflow/Cargo.toml
  • workflow/README.md
  • workflow/iii.worker.yaml
  • workflow/src/config.rs
  • workflow/src/configuration.rs
  • workflow/src/functions/inject_guidance.rs
  • workflow/src/functions/stamp_reply.rs
  • workflow/src/main.rs

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.

@github-actions

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 61 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

…injection via configuration entries, hot-applied

Move each worker's system-prompt usage guidance behind an inject_guidance
knob (ON by default) in its builtin-configuration entry: flipping it binds
or unbinds the pre-generate hook live, no restart, shrinking agent prompts
when the guidance is not wanted. The non-harness half of the token-usage
work.

The config plumbing all five share lives in the new crates/config-client
(iii-sdk range dep, the console-ui precedent): retry ladder with a
NOT_FOUND fast-path, seed-only-when-nothing-stored (configuration::register
REPLACES the stored value whenever initial_value is supplied, so the
pre-check is load-bearing), case-SENSITIVE NOT_FOUND so an absent config
plane never reads as "nothing stored yet", serialized reloads with the
fetch inside the lock, and a post-bind boot refresh closing the fetch->bind
gap; scrapling mirrors the same semantics in Python. All five treat the
config path as best-effort at boot — warn and run on defaults rather than
taking the worker's real surface off the bus (docs/sops/configuration.md
now documents the cosmetic-knob exception).

Also in this change:

- sandbox-code-runner seeds on-config-change + ui-content into the claims
  registry (seeded_ids, the code-runner pattern), closing a boot window
  where a guest register_function could claim a late-registered worker id
  and abort the process via the SDK's duplicate-id panic.
- sandbox-code-runner's dead custom console form is removed (it predated
  the entry and would have hidden the knob behind stale timeout fields);
  the console's schema-generated form renders the entry, and the README
  documents it.
- fp ships no injected UI for its one boolean; the fp/ui package, build.rs,
  and src/ui.rs are gone and the schema form serves the knob.
- llm-router resolves composite "provider::model" ids (the console display
  form) at the choke points: catalog queries retry an exact miss via the
  split pair with supports delegating to get, and chat/route/count_tokens
  split known-provider composites before dispatch — metadata and routing
  can never disagree about the same id. Rebased over the provider-lifecycle
  hardening (#812): availability checks run against the split pair.
- workflow's stamp-reply and inject-guidance hook responses are typed
  structs (the interface publish gate refuses AnyValue response schemas);
  inject-guidance also adopts fp's rule of preserving the harness prompt on
  an empty/drifted base instead of replacing it with guidance alone, and
  stamp-reply's no-op answers an explicit continue (parsed identically to
  the old null).
- provider-llamacpp, github-copilot, kimi, and openrouter tag their
  router-ready handlers internal, keeping the default
  engine::functions::list free of provider plumbing; the four providers'
  lockfiles are regenerated so the per-worker --locked gates resolve.
- rust-security-audit audits every changed lockfile with a full fetch: the
  old --no-fetch on later iterations made each lockfile after the first
  fail its yanked lookups against a half-warmed index; the
  workflow-convention test pinning the old flag is updated, and the audit's
  first real catch on these lockfiles — quinn-proto RUSTSEC-2026-0185 in the
  kimi and web locks — is patched by a lock-only bump.
- '!<worker>::on-config-change' denies for all five workers (web and
  workflow were missing theirs too) and configuration dependencies in the
  fp / sandbox-code-runner / workflow / scrapling manifests.
@andersonleal
andersonleal force-pushed the fix/token-usage-non-harness branch from 8d58c8b to d2c1973 Compare August 18, 2026 17:31
@andersonleal andersonleal changed the title feat(fp,web,workflow,sandbox-code-runner,scrapling): opt-in guidance injection via configuration entries, hot-applied (MOT-4497) feat(fp,web,workflow,sandbox-code-runner,scrapling): opt-in guidance injection via configuration entries, hot-applied Aug 18, 2026
…kit lockfile with post-release provider versions
@andersonleal
andersonleal merged commit 7ac3e61 into main Aug 18, 2026
54 checks passed
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.

1 participant