Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .github/workflows/pr-website-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
run: ./scripts/verify-build.sh

- name: Setup Node.js for Wrangler
if: env.CLOUDFLARE_API_TOKEN != ''
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
Expand Down Expand Up @@ -78,7 +79,7 @@ jobs:
echo "preview-url=$preview_url" >> "$GITHUB_OUTPUT"

- name: Comment preview URL
if: steps.cloudflare-pages.outputs.preview-url != ''
if: env.CLOUDFLARE_API_TOKEN != '' && steps.cloudflare-pages.outputs.preview-url != ''
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
PREVIEW_URL: ${{ steps.cloudflare-pages.outputs.preview-url }}
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions crates/goose-cli/src/commands/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ fn prompt_interactive_session_removal(sessions: &[Session]) -> Result<Vec<Sessio
&s.name
};
let truncated_desc = safe_truncate(desc, TRUNCATED_DESC_LENGTH);
let display_text = format!("{} - {} ({})", s.updated_at, truncated_desc, s.id);
let display_text =
format!("{} - {} ({})", session_activity_at(s), truncated_desc, s.id);
(display_text, s.clone())
})
.collect();
Expand Down Expand Up @@ -150,6 +151,10 @@ fn write_line_or_broken_pipe_ok<W: Write>(out: &mut W, line: &str) -> Result<boo
}
}

fn session_activity_at(session: &Session) -> chrono::DateTime<chrono::Utc> {
session.last_message_at.unwrap_or(session.updated_at)
}

pub async fn handle_session_list(
format: String,
ascending: bool,
Expand All @@ -170,9 +175,9 @@ pub async fn handle_session_list(
}

if ascending {
sessions.sort_by(|a, b| a.updated_at.cmp(&b.updated_at));
sessions.sort_by_key(session_activity_at);
} else {
sessions.sort_by(|a, b| b.updated_at.cmp(&a.updated_at));
sessions.sort_by_key(|b| std::cmp::Reverse(session_activity_at(b)));
}

if let Some(n) = limit {
Expand Down Expand Up @@ -206,7 +211,7 @@ pub async fn handle_session_list(
"{} - {} - {} - {}",
session.id,
session.name,
session.updated_at,
session_activity_at(&session),
display_path_with_tilde(&session.working_dir)
);
if !write_line_or_broken_pipe_ok(&mut out, &output)? {
Expand Down
Loading
Loading