Synced from monorepo
Changes: - Classify clipboard delivery confidence - Add durable session update append - Scope the xAI session bearer to first-party memory embedding endpoints - Persist subagent outputs to disk and bound long-lived agent state - Add MiniSweAgent:bash for mini-swe-agent parity - Revert taking local sessions off the persistent shell - Contextual tip recommending grok wrap on SSH sessions - Voice STT bearer from model BYOK env_key/api_key - Define exact website policies for sandbox - Gate unsafe shell environments - Shared pin hoist; single require_sha gate for marketplace plugins - Server-signed is-managed claim (closes sidecar-removal downgrade) - Optional require_sha pin for remote plugin installs - Show session title and last exchange in the exit resume hint - Gate shell output redirects - Warn when fail_closed is present but not a boolean - Add canonical text editing core (ratatui-textarea) - Keep execution state out of goal scratch - Add acknowledged persistence primitives - Inherit child network restrictions in sandbox - Fail closed when hook matchers fail to recompile - Add MCP setup preferences for plugin MCPs - Gate sourced shell scripts - Gate file-typed project hooks - grok wrap: restore terminal modes on child death - Harden owner-only permissions on auth and MCP credentials - Create crash dump files with owner-only permissions - Write the agent_id cache owner-only (0600) - SessionMetrics mode skips Mixpanel profile sync - Dashboard: slim live-tail peek - Yank full queued prompt text, not (+N lines) - Defeat clock-rollback on the signed managed-config cache - Stop early session/cancel from overtaking the prompt and wedging the turn slot - Self-heal a diverged agent entrypoint on startup - Add matched inference expectations in test-support - Add AuthSingleFlight cancel/successor gap tests - Remove consumer from external OTEL allowlist and pin scrub coverage - Enable /copy in minimal mode - Surface capacity and API-key detail on 429 errors - Single-flight interactive auth - Fix PageUp/PageDown skipping lines behind sticky prompt header
This commit is contained in:
parent
8adf9013a0
commit
98c3b2438a
225 changed files with 18836 additions and 7156 deletions
|
|
@ -17,14 +17,31 @@ fn format_acp_error_reads_detail_from_wrapped_data() {
|
|||
assert_eq!(format_acp_error(& wrapped, false), "model does not support tools");
|
||||
}
|
||||
#[test]
|
||||
fn format_acp_error_rate_limit_is_auth_aware() {
|
||||
fn format_acp_error_rate_limit_surfaces_detail_or_fallback() {
|
||||
use xai_grok_shell::sampling::error::{
|
||||
RATE_LIMITED_ERROR_CODE, RATE_LIMITED_USER_MESSAGE_API_KEY,
|
||||
RATE_LIMITED_USER_MESSAGE_OAUTH,
|
||||
FREE_USAGE_USER_MESSAGE, RATE_LIMITED_ERROR_CODE,
|
||||
RATE_LIMITED_USER_MESSAGE_API_KEY, RATE_LIMITED_USER_MESSAGE_OAUTH,
|
||||
};
|
||||
let err = acp::Error::new(RATE_LIMITED_ERROR_CODE, "Rate limited").data("slow down");
|
||||
assert_eq!(format_acp_error(& err, false), RATE_LIMITED_USER_MESSAGE_OAUTH);
|
||||
assert_eq!(format_acp_error(& err, true), RATE_LIMITED_USER_MESSAGE_API_KEY);
|
||||
let capacity = acp::Error::new(RATE_LIMITED_ERROR_CODE, "Rate limited")
|
||||
.data(
|
||||
"The service is temporarily at capacity. Please retry your request shortly.",
|
||||
);
|
||||
let cap = "The service is temporarily at capacity. Please retry your request shortly.";
|
||||
assert_eq!(format_acp_error(& capacity, false), cap);
|
||||
assert_eq!(format_acp_error(& capacity, true), cap);
|
||||
let rpm = acp::Error::new(RATE_LIMITED_ERROR_CODE, "Rate limited")
|
||||
.data(
|
||||
"You are sending requests too quickly. Please slow down, or upgrade to a Grok subscription for higher limits: https://grok.com/supergrok",
|
||||
);
|
||||
assert!(format_acp_error(& rpm, false).contains("grok.com/supergrok"));
|
||||
assert_eq!(format_acp_error(& rpm, true), RATE_LIMITED_USER_MESSAGE_API_KEY);
|
||||
let empty = acp::Error::new(RATE_LIMITED_ERROR_CODE, "Rate limited");
|
||||
assert_eq!(format_acp_error(& empty, false), RATE_LIMITED_USER_MESSAGE_OAUTH);
|
||||
assert_eq!(format_acp_error(& empty, true), RATE_LIMITED_USER_MESSAGE_API_KEY);
|
||||
let free = acp::Error::new(RATE_LIMITED_ERROR_CODE, "Rate limited")
|
||||
.data("subscription:free-usage-exhausted: You have used all your free usage.");
|
||||
assert_eq!(format_acp_error(& free, false), FREE_USAGE_USER_MESSAGE);
|
||||
assert_eq!(format_acp_error(& free, true), FREE_USAGE_USER_MESSAGE);
|
||||
}
|
||||
/// Non-empty token ranges ride the wire block meta as `skillTokenRanges`
|
||||
/// byte pairs; the text itself is untouched.
|
||||
|
|
|
|||
Loading…
Reference in a new issue