aKode 0.7.0: header di sessione solo ai provider locali, frase d'identità precisata

- session-id, thread-id e x-client-request-id (HTTP e handshake WebSocket) vanno solo ai provider
  locali o in LAN, come client_metadata; test client_tests::session_headers_are_sent_only_to_local_providers.
- Istruzioni di sistema (default.md e models-manager/prompt.md, identici): solo la frase d'identità,
  ora «fork privato dell'utente di un agente di coding open source, sul suo server imeAI»; nessuna
  attribuzione a imeAI o ad aziende (5/5).
- Versione 0.7.0, Novità nel README, snapshot della TUI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-15 05:42:46 +01:00
parent 42f6ee7d5a
commit b87057603d
35 changed files with 249 additions and 197 deletions

312
akode-rs/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -156,7 +156,7 @@ members = [
resolver = "2"
[workspace.package]
version = "0.6.0"
version = "0.7.0"
# Track the edition for all workspace crates in one place. Individual
# crates can still override this value, but keeping it here means new
# crates created with `cargo new -w ...` automatically inherit the 2024

View File

@@ -1359,13 +1359,16 @@ impl ModelClient {
/*turn_state*/ None,
);
add_originator_header(&mut headers, self.state.originator.as_str());
if let Ok(header_value) = HeaderValue::from_str(&responses_metadata.thread_id) {
headers.insert("x-client-request-id", header_value);
// Gli id di sessione e thread vanno solo ai provider locali o in LAN (come client_metadata).
if self.share_client_identity() {
if let Ok(header_value) = HeaderValue::from_str(&responses_metadata.thread_id) {
headers.insert("x-client-request-id", header_value);
}
headers.extend(build_session_headers(
Some(self.responses_session_id(responses_metadata)),
Some(responses_metadata.thread_id.to_string()),
));
}
headers.extend(build_session_headers(
Some(self.responses_session_id(responses_metadata)),
Some(responses_metadata.thread_id.to_string()),
));
headers.extend(self.build_responses_compatibility_headers(responses_metadata));
headers.insert(
OPENAI_BETA_HEADER,
@@ -1418,9 +1421,12 @@ impl<'a> ResponsesHttpExecutor<'a> {
responses_metadata: &CodexResponsesMetadata,
use_responses_lite: bool,
) -> ApiResponsesOptions {
// Gli id di sessione e thread (header session-id/thread-id) vanno solo ai provider
// locali o in LAN, come client_metadata.
let share_identity = self.client.share_client_identity();
ApiResponsesOptions {
session_id: Some(self.client.responses_session_id(responses_metadata)),
thread_id: Some(responses_metadata.thread_id.to_string()),
session_id: share_identity.then(|| self.client.responses_session_id(responses_metadata)),
thread_id: share_identity.then(|| responses_metadata.thread_id.to_string()),
session_source: Some(self.client.state.session_source.clone()),
extra_headers: {
let mut headers = build_responses_headers(

View File

@@ -2310,3 +2310,43 @@ fn local_provider_request_merges_leading_instructions_only() -> anyhow::Result<(
assert_eq!(body[2]["content"][0]["text"], "late");
Ok(())
}
#[tokio::test]
async fn session_headers_are_sent_only_to_local_providers() {
for (base_url, local) in [
("http://127.0.0.1:8080/v1", true),
("http://192.168.40.25:8080/v1", true),
("https://openrouter.ai/api/v1", false),
("https://example.com/v1", false),
] {
let mut client = test_model_client(SessionSource::Exec);
Arc::get_mut(&mut client.state)
.expect("test client should have unique session state")
.provider = create_model_provider(
create_oss_provider_with_base_url(base_url, WireApi::Responses),
/*auth_manager*/ None,
);
let responses_metadata = test_responses_metadata_for_client(
&client,
Some("turn-1"),
format!("{}:1", client.state.thread_id),
/*parent_thread_id*/ None,
TestCodexResponsesRequestKind::Turn,
);
// HTTP: header session-id / thread-id / x-client-request-id.
let options = crate::client::ResponsesHttpExecutor::new(&client)
.build_responses_options(
&Arc::new(std::sync::OnceLock::new()),
&responses_metadata,
/*use_responses_lite*/ false,
)
.await;
assert_eq!(options.session_id.is_some(), local, "{base_url}");
assert_eq!(options.thread_id.is_some(), local, "{base_url}");
// WebSocket: stessi header nell'handshake.
let headers = client.build_websocket_headers(&responses_metadata).await;
for name in ["session-id", "thread-id", "x-client-request-id"] {
assert_eq!(headers.contains_key(name), local, "{base_url}: {name}");
}
}
}

View File

@@ -1,5 +1,5 @@
You are aKode, a coding agent that runs in the user's terminal on their own machine, powered by a locally hosted or self-chosen model. You are precise, safe and helpful. Always reply in the user's language; keep code, commands, identifiers and file paths as they are.
Your name is aKode. If asked who you are or who made you, say you are aKode, a private coding agent running on the user's own imeAI server; never claim to be another product or company.
Your name is aKode. If asked who you are or who made you, answer that you are aKode, the user's private fork of an open-source coding agent, and that you run on the user's imeAI server (name it); imeAI is the server, not your maker, and no company made you, so never say that imeAI, another product or a company created you.
You can read the workspace, run shell commands, edit files with `apply_patch`, keep a plan with `update_plan`, and, when available, use MCP tools and `web_search` / `web_fetch`. Depending on the configuration, some actions run in a sandbox or need the user's approval.

View File

@@ -1,5 +1,5 @@
You are aKode, a coding agent that runs in the user's terminal on their own machine, powered by a locally hosted or self-chosen model. You are precise, safe and helpful. Always reply in the user's language; keep code, commands, identifiers and file paths as they are.
Your name is aKode. If asked who you are or who made you, say you are aKode, a private coding agent running on the user's own imeAI server; never claim to be another product or company.
Your name is aKode. If asked who you are or who made you, answer that you are aKode, the user's private fork of an open-source coding agent, and that you run on the user's imeAI server (name it); imeAI is the server, not your maker, and no company made you, so never say that imeAI, another product or a company created you.
You can read the workspace, run shell commands, edit files with `apply_patch`, keep a plan with `update_plan`, and, when available, use MCP tools and `web_search` / `web_fetch`. Depending on the configuration, some actions run in a sandbox or need the user's approval.

View File

@@ -10,7 +10,7 @@ expression: "render_bottom_popup(&app.chat_widget,\nwidth).replace(r\"C:\\cli-bu
│
Update daemon and exit aKode?
Use this CLI package v0.6.0 from /x/cli-build/bin/akode. Copy the
Use this CLI package v0.7.0 from /x/cli-build/bin/akode. Copy the
complete package and pin it against automatic updates.
This may restart the daemon and interrupt active or queued work.
Codex exits to update in this terminal. Relaunch it afterward.

View File

@@ -4,7 +4,7 @@ expression: "format!(\"enabled:\\n{}\\n---\\ndisabled:\\n{}\", text(after), text
---
enabled:
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ GPT-5.6-Sol · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██
@@ -50,7 +50,7 @@ enabled:
---
disabled:
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ GPT-5.6-Sol · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██

View File

@@ -3,7 +3,7 @@ source: tui/src/app/tests.rs
expression: rendered
---
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ gpt-test · mock
██▄▄██▄▄██ <thread cwd>
██▀████▀██

View File

@@ -3,7 +3,7 @@ source: tui/src/app/tests/realtime_requests.rs
expression: "normalize_voice_snapshot_directory(&rendered, &app.config.cwd)"
---
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ gpt-test · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██

View File

@@ -3,7 +3,7 @@ source: tui/src/app/tests/realtime_requests.rs
expression: "normalize_voice_snapshot_directory(&rendered, &app.config.cwd)"
---
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ gpt-test · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██

View File

@@ -14,7 +14,7 @@ Restored owner:
127.0.0.1:9 · gpt-test · /tmp/project ctx 0% · -- t/s
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ gpt-test · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██

View File

@@ -3,7 +3,7 @@ source: tui/src/app/tests/realtime_requests.rs
expression: "normalize_voice_snapshot_directory(&rendered, &app.config.cwd)"
---
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ gpt-test · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██

View File

@@ -2,7 +2,7 @@
source: tui/src/app/tests/new_session_tests.rs
expression: "normalize_snapshot_paths(render_bottom_popup(&app.chat_widget, 80))"
---
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ loading · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██

View File

@@ -4,7 +4,7 @@ expression: "normalize_snapshot_paths(normalize_agent_center_snapshot(snapshots.
---
80 columns
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ gpt-test · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██
@@ -26,7 +26,7 @@ expression: "normalize_snapshot_paths(normalize_agent_center_snapshot(snapshots.
32 columns
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ gpt-test · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██

View File

@@ -3,7 +3,7 @@ source: tui/src/history_cell/tests.rs
expression: rendered
---
▄▄████▄▄ aKode v0.6.0
▄▄████▄▄ aKode v0.7.0
██▀▀██▀▀██ gpt-5 · mock
██▄▄██▄▄██ /tmp/project
██▀████▀██

View File

@@ -7,7 +7,7 @@ expression: rendered
Scegli i colori; potrai cambiarli con /theme.
1. Automatico │ ▄▄████▄▄ aKode v0.6.0
1. Automatico │ ▄▄████▄▄ aKode v0.7.0
2. Scuro │ ██▀▀██▀▀██ qwen3.6-35b-a3b
3. Chiaro │ ██▄▄██▄▄██ ~/progetto
4. Alto contrasto │ ██▀████▀██

View File

@@ -7,7 +7,7 @@ expression: rendered
Scegli i colori; potrai cambiarli con /theme.
1. Automatico │ ▄▄████▄▄ aKode v0.6.0
1. Automatico │ ▄▄████▄▄ aKode v0.7.0
2. Scuro │ ██▀▀██▀▀██ qwen3.6-35b-a3b
3. Chiaro │ ██▄▄██▄▄██ ~/progetto
4. Alto contrasto │ ██▀████▀██

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning high, summaries detailed)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Server: Local background server

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Server: unix:///tmp/codex-home/app-server-control/app-server-
control.sock (v0.133.0)

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: ガパガパガパガ
パ-model (reasoning

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning high, summaries
detailed)

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning medium, summaries auto)
Directory: [[workspace]]

View File

@@ -4,7 +4,7 @@ expression: sanitized
---
/status
>_ aKode (v0.6.0)
>_ aKode (v0.7.0)
Model: gpt-5.1-codex-max (reasoning none, summaries auto)
Directory: [[workspace]]