Repository navigation
Harden WorkBuddy risk controls - #96
Merged
Merged
Conversation
|
Sorry @maiphucgiang, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 2 days and 23 hours by commenting |
Reviewer's GuideHardens WorkBuddy request handling by adding a narrow always-on channel-identity scrub, classifying upstream business codes before transport status to prevent unsafe replay and persist account restrictions, propagating those restrictions through automation, isolating legacy sessions by account, and aligning regional client identities and WorkBuddy tracing with verified package behavior; documentation and regression coverage are updated accordingly. Sequence diagram for account restriction propagationsequenceDiagram
participant Automation
participant RestrictionSync
participant CredentialPool
participant Ledger
participant NextTask
Automation->>RestrictionSync: _sync_restriction(result)
RestrictionSync->>CredentialPool: note_restriction(cm, 11140)
CredentialPool->>CredentialPool: cooldown(cm)
CredentialPool->>CredentialPool: _auto_disable(cm)
RestrictionSync->>Ledger: note_error(account, phase)
RestrictionSync-->>Automation: stop current sweep
Automation-->>NextTask: skip remaining claims and tasks
Flow diagram for upstream business-code risk controlsflowchart TD
A[Upstream response] --> B[Parse business code]
B --> C{Code classification}
C -->|11140| D[Persistently disable account]
C -->|11148| E[Cool account and model for 30 minutes]
C -->|11128| F[No cross-account replay]
C -->|11129 11134 11150 11158| G[Return upstream response]
C -->|11102| H[Allow console-confirmed model failover]
C -->|Other| I[Apply HTTP status policy]
Flow diagram for always-on channel identity scrubbingflowchart TD
A[Chat request] --> B[_chat_body_desensitize]
B --> C[desensitize_channel_body]
C --> D{Message role}
D -->|system developer assistant| E[desensitize_channel_text]
E --> F[Replace DSH identity sentence]
D -->|user or tool| G[Preserve content]
F --> H[Continue normal desensitization switch]
G --> H
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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
empty/prependsystem prompt modes through WebUI, CLI andCODEBUDDY2API_PROMPT_MODE: default to no gateway-added prompt, or prepend concise official WorkBuddy/CodeBuddy prefixes after routing without duplicating them on retries.Tests
for s in tests/test_*.py; do uv run python -B "$s"; done— 86 standalone files, 2083 tests passed.git diff --check main...HEAD