Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,14 @@ fn cmd_auth(config_path: Option<std::path::PathBuf>, auth_cmd: AuthCommand) -> a
} else {
eprintln!("Anthropic OAuth: valid (expires in {}m)", expires_min);
}
eprintln!(" access token: {}...", &creds.access_token[..20]);
eprintln!(" refresh token: {}...", &creds.refresh_token[..20]);
eprintln!(
" access token: {}...",
&creds.access_token[..creds.access_token.floor_char_boundary(20)]
);
eprintln!(
" refresh token: {}...",
&creds.refresh_token[..creds.refresh_token.floor_char_boundary(20)]
);
Comment thread
l33t0 marked this conversation as resolved.
Resolved
eprintln!(
" credentials file: {}",
spacebot::auth::credentials_path(&instance_dir).display()
Expand Down
6 changes: 3 additions & 3 deletions src/tools/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ fn render_snapshot_node(node: &SnapshotNode, depth: usize, output: &mut String)
output.push_str(" \"");
// Truncate very long names for context efficiency.
let display_name = if node.name.len() > 200 {
format!("{}...", &node.name[..200])
format!("{}...", &node.name[..node.name.floor_char_boundary(200)])
Comment thread
l33t0 marked this conversation as resolved.
Resolved
} else {
node.name.clone()
};
Expand Down Expand Up @@ -575,7 +575,7 @@ fn render_snapshot_node(node: &SnapshotNode, depth: usize, output: &mut String)
// Value (e.g., text input current value)
if let Some(ref value) = node.value {
let display_value = if value.len() > 100 {
format!("{}...", &value[..100])
format!("{}...", &value[..value.floor_char_boundary(100)])
} else {
value.clone()
};
Expand Down Expand Up @@ -1589,7 +1589,7 @@ impl Tool for BrowserTypeTool {
)
} else {
let display_text = if text_value.len() > 50 {
format!("{}...", &text_value[..50])
format!("{}...", &text_value[..text_value.floor_char_boundary(50)])
} else {
text_value
};
Expand Down
Loading