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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable Phonton CLI release changes should be documented here.

This project follows pre-1.0 SemVer: minor versions may still include breaking changes while the public API and CLI surface settle.

## 0.4.6 - Cloudflare Diagnostics

### Fixed

- Settings connection tests now report missing Cloudflare Account ID or Workers AI base URL instead of incorrectly saying `cloudflare` is an unknown provider.
- Failed goal details are now shown in the Active panel so configuration failures remain visible after a goal stops.

## 0.4.5 - Provider Config Panic Fix

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="assets/readme/phonton-cli-logo.png" width="112" alt="Phonton CLI logo">
</p>

<h1 align="center">Phonton CLI · v0.4.5</h1>
<h1 align="center">Phonton CLI · v0.4.6</h1>

<p align="center">
<strong>Verified code changes with repo memory.</strong><br>
Expand All @@ -12,7 +12,7 @@
<p align="center">
<a href="https://github.com/phonton-dev/phonton-cli/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/phonton-dev/phonton-cli/actions/workflows/ci.yml/badge.svg"></a>
<a href="https://github.com/phonton-dev/phonton-cli/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/phonton-dev/phonton-cli?style=flat&label=stars"></a>
<img alt="release" src="https://img.shields.io/badge/release-v0.4.5-6c63ff">
<img alt="release" src="https://img.shields.io/badge/release-v0.4.6-6c63ff">
<img alt="license" src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue">
<img alt="status" src="https://img.shields.io/badge/status-public_alpha-f97316">
</p>
Expand Down Expand Up @@ -103,7 +103,7 @@ Windows PowerShell:
Direct Cargo install:

```bash
cargo install --git https://github.com/phonton-dev/phonton-cli --tag v0.4.5 phonton-cli --locked --force
cargo install --git https://github.com/phonton-dev/phonton-cli --tag v0.4.6 phonton-cli --locked --force
```

Check the install:
Expand All @@ -119,7 +119,7 @@ Phonton uses GitHub branches and releases as install channels:

| Channel | Install | Use when |
|---|---|---|
| Stable | `cargo install --git https://github.com/phonton-dev/phonton-cli --tag v0.4.5 phonton-cli --locked --force` | You want the best validated public alpha |
| Stable | `cargo install --git https://github.com/phonton-dev/phonton-cli --tag v0.4.6 phonton-cli --locked --force` | You want the best validated public alpha |
| Dev | `cargo install --git https://github.com/phonton-dev/phonton-cli --branch dev phonton-cli --locked --force` | You want next-release integration changes |
| Nightly | `cargo install --git https://github.com/phonton-dev/phonton-cli --branch nightly phonton-cli --locked --force` | You want daily snapshots and can tolerate breakage |
| Main | `cargo install --git https://github.com/phonton-dev/phonton-cli --branch main phonton-cli --locked --force` | You want the current release branch tip |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phonton-cli",
"version": "0.4.5",
"version": "0.4.6",
"description": "Local-first agentic development terminal with context packs, source handles, and verification gates.",
"license": "MIT OR Apache-2.0",
"homepage": "https://github.com/phonton-dev/phonton-cli#readme",
Expand Down
2 changes: 1 addition & 1 deletion phonton-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "phonton-cli"
version = "0.4.5"
version = "0.4.6"
edition.workspace = true
license.workspace = true
repository.workspace = true
Expand Down
72 changes: 71 additions & 1 deletion phonton-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2617,6 +2617,30 @@ fn render_centre(frame: &mut Frame, area: Rect, app: &App) {
app.new_best_ticks,
));

if let TaskStatus::Failed {
reason,
failed_subtask,
} = &state.task_status
{
lines.push(Line::raw(""));
lines.push(Line::from(vec![
Span::styled(
"Failure: ",
Style::default().fg(DANGER).add_modifier(Modifier::BOLD),
),
Span::styled(reason.clone(), Style::default().fg(Color::White)),
]));
if let Some(subtask) = failed_subtask {
lines.push(Line::from(vec![
Span::styled(" subtask ", Style::default().fg(MUTED)),
Span::styled(
subtask.to_string(),
Style::default().fg(ACCENT_HI).add_modifier(Modifier::BOLD),
),
]));
}
}

if let Some(handoff) = &state.handoff_packet {
append_handoff_lines(&mut lines, handoff);
}
Expand Down Expand Up @@ -3808,7 +3832,7 @@ async fn test_provider(
return Err("no API key — paste one in the API Key field or set the env var".into());
}
let cfg = make_api_provider_config(&name, api_key, model, account_id, base_url)
.ok_or_else(|| format!("unknown provider `{name}`"))?;
.ok_or_else(|| provider_config_failure_message(&name))?;
let provider: Arc<dyn Provider> = Arc::from(provider_for(cfg));
let resp = provider
.call(
Expand Down Expand Up @@ -5957,6 +5981,22 @@ fn extract_id(line: &str) -> Option<String> {
assert!(provider_config_failure_message("cloudflare").contains("Account ID"));
}

#[tokio::test]
async fn test_provider_missing_cloudflare_account_reports_account_id() {
let err = test_provider(
"cloudflare".into(),
"cf-token".into(),
"@cf/moonshotai/kimi-k2.6".into(),
None,
None,
)
.await
.expect_err("missing Cloudflare account should fail before network call");
Comment on lines +5990 to +5994

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Isolate Cloudflare test from ambient account-id env

This test assumes test_provider(..., None, None) always fails before any network call, but make_api_provider_config resolves Cloudflare base URL from CLOUDFLARE_ACCOUNT_ID when account_id is None, so in environments where that variable is set the provider config is valid and the test reaches a real API call path instead of returning the expected setup error. That makes the assertion flaky and environment-dependent; clear or override CLOUDFLARE_ACCOUNT_ID in this test to keep it deterministic.

Useful? React with 👍 / 👎.


assert!(err.contains("Account ID"));
assert!(!err.contains("unknown provider"));
}

#[test]
fn provider_config_template_replaces_model_without_losing_endpoint() {
let template = make_api_provider_config(
Expand Down Expand Up @@ -6637,6 +6677,36 @@ fn extract_id(line: &str) -> Option<String> {
assert!(dump.contains("Known gaps"));
}

#[test]
fn renders_failed_goal_reason() {
let backend = TestBackend::new(120, 30);
let mut terminal = Terminal::new(backend).unwrap();
let mut app = App::default();
app.goals.push(GoalEntry::new("make chess".into()));
app.apply_state(
0,
GlobalState {
task_status: TaskStatus::Failed {
reason: "Cloudflare requires an Account ID".into(),
failed_subtask: None,
},
goal_contract: None,
handoff_packet: None,
active_workers: Vec::new(),
tokens_used: 0,
tokens_budget: None,
estimated_naive_tokens: 35000,
checkpoints: Vec::new(),
},
);

terminal.draw(|f| render(f, &app)).unwrap();
let buf = terminal.backend().buffer().clone();
let dump: String = buf.content().iter().map(|c| c.symbol()).collect();
assert!(dump.contains("Failure"));
assert!(dump.contains("Cloudflare requires an Account ID"));
}

#[test]
fn renders_with_active_goal_and_savings() {
let backend = TestBackend::new(120, 30);
Expand Down
15 changes: 15 additions & 0 deletions release-notes/v0.4.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Phonton CLI v0.4.6

Patch release for Cloudflare provider diagnostics.

## Fixed

- Settings connection tests now surface the real Cloudflare setup requirement when the Account ID or Workers AI base URL is missing.
- Failed goals now show their failure reason in the Active panel, so provider setup issues stay visible after the run stops.

## Verification

- `cargo fmt --all -- --check`
- `cargo clippy --locked --workspace --all-targets -- -D warnings`
- `cargo test --locked --workspace`
- `cargo build --release --locked -p phonton-cli`
Loading