Fix status/token regressions and Teams large-file uploads#26712
Closed
zwright8 wants to merge 20 commits intoopenclaw:mainfrom
Closed
Fix status/token regressions and Teams large-file uploads#26712zwright8 wants to merge 20 commits intoopenclaw:mainfrom
zwright8 wants to merge 20 commits intoopenclaw:mainfrom
Conversation
too many skills to
added 5 commits
February 25, 2026 12:07
Contributor
|
Thanks for the PR! This touches 299 files across many unrelated subsystems (status reporting, token handling, Teams uploads, and more). Per project guidelines, please break this into focused single-topic PRs so each can be reviewed and merged independently. This is an AI-assisted triage review. If we got this wrong, feel free to reopen or start new focused PRs — happy to revisit. |
This was referenced Mar 3, 2026
Author
|
Thanks for the guidance on scope. I split the useful changes from this PR into focused single-topic PRs:
I intentionally did not re-open the bulk generated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Describe the problem and fix in 2–5 bullets:
/statusignored per-modelcontext1m, daemon restart token drift warnings could false-positive,status --jsoncould surface negative token counters, and Teams large-file uploads could fail on simple upload.params.context1mandparams.contextTokens) to status/directive paths, normalized compared gateway tokens before drift checks, ignored negative usage counters during normalization, and added Graph upload-session fallback for large Teams uploads.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
openclaw status --jsonintermittently reports negativeinputTokens#25242User-visible / Behavior Changes
/statusnow reflects per-model context overrides (includingcontext1m) instead of always defaulting to catalog context.openclaw gateway restartno longer reports a token mismatch when config and service tokens only differ by wrapping quotes/whitespace.openclaw status --jsonno longer propagates negative usage counters as negative token fields.Security Impact (required)
Yes/No) NoYes/No) YesYes/No) YesYes/No) NoYes/No) NoYes, explain risk + mitigation:Token handling change only affects normalization for equality checks (no new token exposure/storage paths). Teams upload change adds documented Graph upload-session calls for large files; existing auth scope is reused and behavior is covered by tests.
Repro + Verification
Environment
context1m), gateway token authSteps
openclaw/mainstays scoped to intended files.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm test extensions/msteams/src/graph-upload.test.tspnpm test src/auto-reply/reply/model-selection.test.tspnpm test src/daemon/service-audit.test.tspnpm test src/agents/usage.normalization.test.tspnpm tsgoquoted/trimmed gateway tokens, per-model
context1m, explicit per-modelcontextTokens, negative usage counters.live Graph API upload against a real tenant in this run.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
revert this PR branch commits.
restore the touched files in
extensions/msteams/src/graph-upload*,src/auto-reply/reply/*,src/daemon/service-audit*, andsrc/agents/usage*.Teams large uploads regressing to 4MB failures, status context reverting to catalog defaults, token drift warning reappearing with matching tokens.
Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.Upload-session flow could behave differently for specific tenant policies.
Added focused tests for session creation/chunk behavior and kept simple-upload path unchanged for small files.
Over-normalizing tokens could mask truly different values if formatting assumptions are wrong.
Normalization is minimal (trim + matching quote unwrap) and only used for drift comparison; mismatched content still reports drift.
Greptile Summary
Fixed four reliability regressions affecting status reporting and Teams file uploads:
context1mandcontextTokensoverrides in/statusand directive paths, preventing incorrect context window reportingopenclaw status --jsonoutputChanges preserve backward compatibility and scope boundaries (no auth behavior changes, no protocol changes). Test coverage validates all regression fixes with focused unit tests.
Confidence Score: 5/5
Last reviewed commit: 3f4b4ce
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!