revert(acms): revert PR #11216 — _resolve_effective_budget reads wrong attribute #11228

Merged
hamza.khyari merged 1 commit from bugfix/m5-revert-acms-budget-assembler into master 2026-05-15 11:47:40 +00:00
Member

Summary

Reverts PR #11216 (fix(acms): use project-level hot_max_tokens in execute phase context assembly).

Reason

PR #11216 replaced the working _resolve_hot_max_tokens() implementation (which read hot_max_tokens from the stored context_policy_json DB column) with _resolve_effective_budget() which reads project.settings.hot_max_tokens — an attribute that is never populated by agents project context set --hot-max-tokens.

The result: the project-level --hot-max-tokens override is silently ignored, and the assembler always falls back to the global 16K default, identical to the pre-fix behaviour.

Verified by running scenario 20 with --hot-max-tokens 32000 — tier logs still showed budget=16000 on both 16K and 32K runs with no observable difference in output.

What is restored

  • _resolve_hot_max_tokens() — original working method that queries context_policy_json from NamespacedProjectModel via raw DB session
  • effective_hot_max_tokens usage in assemble() for both CoreContextBudget and ContextRequest
  • import json (removed by #11216 but required by the restored method)
  • Module-level CRPFragment/CRPProvenance imports removed (were added by #11216 Behave test)
  • Behave regression scenario removed (test mocked project.settings.hot_max_tokens which is the wrong attribute)
  • CHANGELOG entry removed (fix was not working)

Follow-up

A corrected fix should be submitted that:

  1. Keeps the original _resolve_hot_max_tokens() DB-query approach, OR wires project context set to also populate project.settings.hot_max_tokens
  2. Adds a Behave regression test that correctly exercises the context_policy_json code path
  3. References issue #11215

Reverts #11216
Fixes: #11215

## Summary Reverts PR #11216 (`fix(acms): use project-level hot_max_tokens in execute phase context assembly`). ## Reason PR #11216 replaced the working `_resolve_hot_max_tokens()` implementation (which read `hot_max_tokens` from the stored `context_policy_json` DB column) with `_resolve_effective_budget()` which reads `project.settings.hot_max_tokens` — an attribute that is **never populated** by `agents project context set --hot-max-tokens`. The result: the project-level `--hot-max-tokens` override is silently ignored, and the assembler always falls back to the global 16K default, identical to the pre-fix behaviour. Verified by running scenario 20 with `--hot-max-tokens 32000` — tier logs still showed `budget=16000` on both 16K and 32K runs with no observable difference in output. ## What is restored - `_resolve_hot_max_tokens()` — original working method that queries `context_policy_json` from `NamespacedProjectModel` via raw DB session - `effective_hot_max_tokens` usage in `assemble()` for both `CoreContextBudget` and `ContextRequest` - `import json` (removed by #11216 but required by the restored method) - Module-level `CRPFragment`/`CRPProvenance` imports removed (were added by #11216 Behave test) - Behave regression scenario removed (test mocked `project.settings.hot_max_tokens` which is the wrong attribute) - CHANGELOG entry removed (fix was not working) ## Follow-up A corrected fix should be submitted that: 1. Keeps the original `_resolve_hot_max_tokens()` DB-query approach, OR wires `project context set` to also populate `project.settings.hot_max_tokens` 2. Adds a Behave regression test that correctly exercises the `context_policy_json` code path 3. References issue #11215 Reverts #11216 Fixes: #11215
hamza.khyari added this to the v3.5.0 milestone 2026-05-15 11:16:22 +00:00
Revert "Merge pull request 'fix(acms): use project-level hot_max_tokens in execute phase context assembly' (#11216) from bugfix/m5-acms-project-budget-override into master"
All checks were successful
CI / push-validation (pull_request) Successful in 41s
CI / helm (pull_request) Successful in 50s
CI / build (pull_request) Successful in 1m13s
CI / lint (pull_request) Successful in 1m34s
CI / typecheck (pull_request) Successful in 1m40s
CI / quality (pull_request) Successful in 1m45s
CI / security (pull_request) Successful in 1m50s
CI / integration_tests (pull_request) Successful in 3m52s
CI / unit_tests (pull_request) Successful in 8m50s
CI / docker (pull_request) Successful in 1m39s
CI / coverage (pull_request) Successful in 12m1s
CI / status-check (pull_request) Successful in 6s
b4351ca78d
This reverts commit 94622f467c, reversing
changes made to 1196c726f2.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!11228
No description provided.