8000 [pull] main from can1357:main by pull[bot] · Pull Request #128 · ericrihm/oh-my-pi · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2d68406
fix(windows): normalize working directories and abbreviate short home…
CoderTCY Sep 26, 2026
d1ec2b9
fix(natives): load Windows path helpers lazily
CoderTCY Sep 26, 2026
e5841d1
fix(release): pack the lazy native path entry in published cores
CoderTCY Sep 26, 2026
42e6bd4
feat(telemetry): add opt-out setting override to disable OTLP export
krizh-p Sep 26, 2026
954eff7
docs(coding-agent): add OTLP opt-out changelog entry
krizh-p Sep 26, 2026
65c4c88
Merge branch 'main' into feat/otel-settings-optout
krizh-p Sep 26, 2026
7d7f5e7
docs(coding-agent): avoid changelog merge conflicts
krizh-p Sep 26, 2026
0c9b856
Merge branch 'main' into feat/otel-settings-optout
krizh-p Sep 27, 2026
fa27789
fix(coding-agent): wait ladder restored to old hub behavior
Sep 27, 2026
66d02b4
docs(coding-agent): credited #13516 in changelog
Sep 27, 2026
76aa566
Merge remote-tracking branch 'origin/main' into fix/wait-message-ladder
Sep 27, 2026
22a14a8
fix(coding-agent): keyed wait owner hint on blocked waits, not delive…
Sep 27, 2026
0b92322
Merge branch 'main' into feat/otel-settings-optout
Sep 27, 2026
9dbe03f
refactor(telemetry): move OTLP opt-out setting to its own module
Sep 27, 2026
908253d
Merge branch 'main' into fix/windows-cwd-display-long-path
Sep 27, 2026
b3c9f58
Merge PR #13516: fix(coding-agent): wait ladder restored to old hub b…
H4vC Sep 27, 2026
1506f69
fix(windows): surface native path failures and cache path bindings
Sep 27, 2026
0f41e5a
style(telemetry): tidy OTLP opt-out comment and spacing
Sep 27, 2026
6a796cf
Merge PR #13394: fix(windows): normalize working directories and abbr…
H4vC Sep 27, 2026
92731fe
fix(pi-edit): keep PUT >N inserts before a closer when moving them br…
radkawar Sep 27, 2026
ed54a49
docs(pi-edit): link landing-shift changelog entry to PR
radkawar Sep 27, 2026
64b7983
Merge PR #13444: feat(telemetry): add opt-out setting override to dis…
H4vC Sep 27, 2026
7a8ac98
fix(pi-edit): veto the landing shift only when the shift itself break…
radkawar Sep 27, 2026
e8063f0
docs(coding-agent): say the eval kernel is shared with concurrent tas…
radkawar Sep 27, 2026
d502301
docs(coding-agent): link eval kernel changelog entry to PR
radkawar Sep 27, 2026
80becaa
chore(pi-edit): dedupe changelog entry with attribution; clarify else…
Sep 27, 2026
8babb72
docs(coding-agent): attribute eval kernel changelog entry, order sect…
Sep 27, 2026
03c252c
Merge PR #13521: docs(coding-agent): say the eval kernel is shared wi…
H4vC Sep 27, 2026
5edcae3
Merge PR #13520: fix(pi-edit): keep PUT >N inserts before a closer wh…
H4vC Sep 27, 2026
83f22f2
feat(coding-agent): eval backend missing
Sep 27, 2026
555a95b
chore(coding-agent): tidy eval backend missing warning
Sep 27, 2026
f7ba1f5
fix(coding-agent): address eval backend missing review feedback
Sep 27, 2026
0a7ab30
fix(coding-agent): cancel startup python probe on shutdown
Sep 27, 2026
6d489e6
fix(coding-agent): surface python eval diagnostic when --tools eval i…
Sep 27, 2026
09e7bf6 Merge pull request #13529 from can1357/feat/eval-backend-missing-warning
H4vC Sep 27, 2026
aa5aab0
test: remove useless tests
Sep 27, 2026
db9cb2d
test(agent): restore resetSyncCursor re-sync test
Sep 27, 2026
83c9df0
Merge PR #13539: test: remove useless tests (@H4vC)
H4vC Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions crates/pi-edit/src/modes/hashline/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,23 @@ fn repair_landings(
outward = Some((landing, crossed));
}
}
// The shift is an indentation guess. Veto it only when the shift itself
// breaks the parse: the batch as written parses, the shifted one does
// not (a shallower `case`, `} else {`, or member belongs before the
// closer). Unrelated broken edits in the batch leave the shift alone.
if let (Some((landing, _)), Some(path)) = (outward, path) {
let mut trial = out.clone();
for &index in &group.members {
if let Edit::Insert { cursor, .. } = &mut trial[index] {
*cursor = Cursor::AfterAnchor(Anchor { line: landing });
}
}
if parses_cleanly(Some(path), &materialize(lines, &out).0)
&& !parses_cleanly(Some(path), &materialize(lines, &trial).0)
{
outward = None;
}
}
if let Some((landing, crossed)) = outward {
for &index in &group.members {
if let Edit::Insert { cursor, .. } = &mut out[index] {
Expand Down
65 changes: 65 additions & 0 deletions crates/pi-edit/tests/fixtures/hashline/parity_landing_shift.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,71 @@
}
}
]
},
{
"name": "keeps a shallower Go case label inside its switch when the shift would break the parse",
"apply": [
{
"text": "package p\n\nfunc f(x int) int {\n\tswitch x {\n\tcase 1:\n\t\treturn 1\n\t}\n\treturn 0\n}\n",
"input": "PUT >6:\n+\tcase 2:\n+\t\treturn 2",
"path": "fixture.go",
"expect": {
"text": "package p\n\nfunc f(x int) int {\n\tswitch x {\n\tcase 1:\n\t\treturn 1\n\tcase 2:\n\t\treturn 2\n\t}\n\treturn 0\n}\n",
"firstChangedLine": 6,
"warnings": []
}
}
]
},
{
"name": "keeps an else branch in place instead of duplicating the if closer",
"apply" 8000 ;: [
{
"text": "package p\n\nfunc f(x bool) int {\n\tif x {\n\t\treturn 1\n\t}\n\treturn 0\n}\n",
"input": "PUT >5:\n+\t} else {\n+\t\treturn 2",
"path": "fixture.go",
"expect": {
"text": "package p\n\nfunc f(x bool) int {\n\tif x {\n\t\treturn 1\n\t} else {\n\t\treturn 2\n\t}\n\treturn 0\n}\n",
"firstChangedLine": 5,
"warnings": []
}
}
]
},
{
"name": "still slides a shallower statement past the closer when the shifted result parses",
"apply": [
{
"text": "package p\n\nfunc f(x bool) int {\n\tif x {\n\t\tx = false\n\t}\n\treturn 0\n}\n",
"input": "PUT >5:\n+\tx = true",
"path": "fixture.go",
"expect": {
"text": "package p\n\nfunc f(x bool) int {\n\tif x {\n\t\tx = false\n\t}\n\tx = true\n\treturn 0\n}\n",
"firstChangedLine": 6,
"warnings": [
"PUT >5: body indented shallower than the anchor, so the landing moved past 1 closing line to after line 6. For the deeper position inside the block, re-issue with the body indented to match."
]
}
}
]
},
{
"name": "still slides a shallower statement when an unrelated edit in the batch breaks the parse",
"apply": [
{
"text": "package p\n\nfunc f(x bool) int {\n\tif x {\n\t\tx = false\n\t}\n\treturn 0\n}\n",
"input": "PUT >5:\n+\tx = true\nPUT >7:\n+\ty := (",
"path": "fixture.go",
"expect": {
"text": "package p\n\nfunc f(x bool) int {\n\tif x {\n\t\tx = false\n\t}\n\tx = true\n\treturn 0\n\ty := (\n}\n",
"firstChangedLine": 6,
"warnings": [
"PUT >5: body indented shallower than the anchor, so the landing moved past 1 closing line to after line 6. For the deeper position inside the block, re-issue with the body indented to match.",
"This edit introduced a syntax error near line 6: the file parsed before the patch and no longer does. It was applied exactly as written, so a line number or range endpoint is likely wrong — re-read the touched region and re-issue a correcting edit."
]
}
}
]
}
]
}
32 changes: 32 additions & 0 deletions crates/pi-natives/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,38 @@ use pi_shell::{
use self::vfs::ShellFilesystem;
use crate::task;

/// Expand Windows 8.3 components without resolving symlinks or junctions.
#[napi]
pub fn expand_windows_long_path(path: String) -> String {
#[cfg(windows)]
{
pi_shell::expand_to_long_path(std::path::Path::new(&path))
.into_os_string()
.into_string()
.unwrap_or(path)
}
#[cfg(not(windows))]
{
path
}
}

/// Get the existing Windows 8.3 spelling; preserve the input when unavailable.
#[napi]
pub fn get_windows_short_path(path: String) -> String {
#[cfg(windows)]
{
pi_shell::get_short_path(std::path::Path::new(&path))
.into_os_string()
.into_string()
.unwrap_or(path)
}
#[cfg(not(windows))]
{
path
}
}

/// N-API opt-in handle for the minimizer.
#[napi(object)]
#[derive(Debug, Clone, Default)]
Expand Down
2 changes: 2 additions & 0 deletions crates/pi-shell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pub mod shell;
pub mod windows;

pub use brush_core::commands::{ChildSessionAction, child_session_action};
// Reuse brush's Windows path spellings for host paths presented by the CLI.
pub use brush_core::sys::fs::{expand_to_long_path, get_short_path};
// Re-exported for `pi-natives`: the builtins live in `pi-builtins`,
// but the native layer only ever depends on the shell.
pub use pi_builtins::{
Expand Down
41 changes: 26 additions & 15 deletions crates/vendor/brush-core/src/sys/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{ffi::OsStr, path::Component};
#[cfg(windows)]
use std::os::windows::ffi::{OsStrExt, OsStringExt};
#[cfg(windows)]
use windows_sys::Win32::Storage::FileSystem::GetLongPathNameW;
use windows_sys::Win32::Storage::FileSystem::{GetLongPathNameW, GetShortPathNameW};

/// Normalizes shell-facing path aliases before `std::fs` sees them.
#[allow(clippy::missing_const_for_fn, reason = "Windows implementation allocates")]
Expand All @@ -33,7 +33,7 @@ pub fn normalize_shell_path(path: &Path) -> Cow<'_, Path> {
/// form, leaving the path otherwise unchanged.
#[cfg(windows)]
pub fn expand_to_long_path(path: &Path) -> PathBuf {
expand_to_long_path_impl(path)
query_path_name(path, GetLongPathNameW)
}

/// Non-Windows: no 8.3 short names, return unchanged.
Expand All @@ -42,13 +42,25 @@ pub fn expand_to_long_path(path: &Path) -> PathBuf {
path.to_path_buf()
}

/// Windows implementation using `GetLongPathNameW`, which resolves short-name
/// aliases but — unlike `std::fs::canonicalize` — does **not** resolve symlinks
/// or junctions, so `cd` into a symlink keeps the symlink spelling (the
/// shell's existing behavior). A path with no short names is returned
/// unchanged; on failure the input is returned as-is.
/// Return the existing Windows 8.3 spelling without resolving symlinks or junctions.
/// If no short spelling is available, preserve the input.
#[cfg(windows)]
fn expand_to_long_path_impl(path: &Path) -> PathBuf {
pub fn get_short_path(path: &Path) -> PathBuf {
query_path_name(path, GetShortPathNameW)
}

/// Non-Windows: preserve the input path.
#[cfg(not(windows))]
pub fn get_short_path(path: &Path) -> PathBuf {
path.to_path_buf()
}

/// Both Win32 name queries preserve symlinks and junctions, unlike canonicalize.
#[cfg(windows)]
fn query_path_name(
path: &Path,
query: unsafe extern "system" fn(*const u16, *mut u16, u32) -> u32,
) -> PathBuf {
// Encode straight from the wide form: Windows `OsStr` is UTF-16 and may
// not round-trip through UTF-8, so a `to_str()` detour would silently skip
// expansion for those paths — exactly the identity split this function
Expand All @@ -57,16 +69,15 @@ fn expand_to_long_path_impl(path: &Path) -> PathBuf {

// First call with a null buffer returns the required size (including the
// terminating NUL); the fill call returns the length excluding the NUL.
// GetLongPathNameW returns 0 on failure (e.g. nonexistent path), in which
// case the input is returned unchanged.
let needed = unsafe { GetLongPathNameW(wide.as_ptr(), std::ptr::null_mut(), 0) };
// Both APIs return 0 on failure (e.g. nonexistent path), in which case
// the input is returned unchanged.
let needed = unsafe { query(wide.as_ptr(), std::ptr::null_mut(), 0) };
if needed == 0 {
return path.to_path_buf();
}
let mut buf = vec![0u16; needed as usize];
loop {
let written =
unsafe { GetLongPathNameW(wide.as_ptr(), buf.as_mut_ptr(), buf.len() as u32) };
let written = unsafe { query(wide.as_ptr(), buf.as_mut_ptr(), buf.len() as u32) };
if written == 0 {
return path.to_path_buf();
}
Expand All @@ -77,10 +88,10 @@ fn expand_to_long_path_impl(path: &Path) -> PathBuf {
buf.truncate(written);
break;
}
// The long form grew between the sizing call and the fill call:
// The result grew between the sizing call and the fill call:
// `written` is the new required size (including the NUL). Grow and
// retry rather than returning partial/zero-padded garbage.
buf = vec![0u16; written];
buf.resize(written, 0);
}
PathBuf::from(std::ffi::OsString::from_wide(&buf))
}
Expand Down
2 changes: 1 addition & 1 deletion docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ These are read as runtime signals; they are usually set by the terminal/OS rathe

## 11) OpenTelemetry export

OMP initializes OTLP export only when at least one signal has an endpoint. `OTEL_SDK_DISABLED=true` disables initialization.
OMP initializes OTLP export only when at least one signal has an endpoint. Set `telemetry.otlpExportEnabled: false` (`/settings` → Providers → Privacy) to skip export even when endpoints are configured. `OTEL_SDK_DISABLED=true` also disables initialization.

| Variable group | Behavior |
| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
Expand Down
2 changes: 2 additions & 0 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,8 @@ tui:

For a custom status line, set `statusLine.preset: custom` and configure `statusLine.leftSegments`, `statusLine.rightSegments`, and `statusLine.segmentOptions`. Include `status` in either segment list to render extension statuses registered through `ctx.ui.setStatus()`, ordered by key and joined inline. Set `statusLine.showHookStatus: false` to suppress the same statuses in the footer.

The `path` segment abbreviates the home directory to `~`. On Windows, shared path formatting recognizes both the long home name and its existing 8.3 aliases (such as `ADMINI~1`), including in tool labels and error text. Only the home prefix is abbreviated; remaining path components keep their spelling, and formatting does not change the working directory or environment. Set `statusLine.segmentOptions.path.abbreviate: false` to keep the full path in the status line.

The `cost` segment shows recorded session costs. For an active provider/model with scheduled pricing, it appends `↑` during peak hours or `↓` off-peak, refreshing at boundaries even while idle. The arrow reflects the current tariff, not past spending; flat-price models and explicit cost overrides have no arrow. See [usage costs and time-based pricing](models.md#usage-costs-and-time-based-pricing) for the UTC schedule and estimation semantics.

### Interaction
Expand Down
90 changes: 0 additions & 90 deletions packages/agent/test/agent-loop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,49 +385,6 @@ describe("agentLoop with AgentMessage", () => {
expect(finalMessage.errorMessage).toBe("Interrupted by user");
});

it("should handle custom message types via convertToLlm", async () => {
// Create a custom message type
interface CustomNotification {
role: "notification";
text: string;
timestamp: number;
}

const notification: CustomNotification = {
role: "notification",
text: "This is a notification",
timestamp: Date.now(),
};

const context: AgentContext = {
systemPrompt: ["You are helpful."],
messages: [notification as unknown as AgentMessage], // Custom message in context
tools: [],
};

let convertedMessages: Message[] = [];
const mock = createMockModel({ responses: [{ content: ["Response"] }] });
const config: AgentLoopConfig = {
model: mock.model,
convertToLlm: messages => {
// Filter out notifications, convert rest
convertedMessages = messages
.filter(m => (m as { role: string }).role !== "notification")
.filter(m => m.role === "user" || m.role === "assistant" || m.role === "toolResult") as Message[];
return convertedMessages;
},
};

const stream = agentLoop([createUserMessage("Hello")], context, config, undefined, mock.stream);
for await (const _ of stream) {
// drain
}

// The notification should have been filtered out in convertToLlm
expect(convertedMessages.length).toBe(1); // Only user message
expect(convertedMessages[0].role).toBe("user");
});

it("should apply transformContext before convertToLlm", async () => {
const context: AgentContext = {
systemPrompt: ["You are helpful."],
Expand Down Expand Up @@ -525,53 +482,6 @@ describe("agentLoop with AgentMessage", () => {
expect(contexts[1]?.index).toBe(1);
});

it("shoul 10BC8 d handle tool calls and results", async () => {
const toolSchema = type({ value: "string" });
const executed: string[] = [];
const tool: AgentTool<typeof toolSchema, { value: string }> = {
name: "echo",
label: "Echo",
description: "Echo tool",
parameters: toolSchema,
async execute(_toolCallId, params) {
executed.push(params.value);
return {
content: [{ type: "text", text: `echoed: ${params.value}` }],
details: { value: params.value },
};
},
};

const context: AgentContext = { systemPrompt: [""], messages: [], tools: [tool] };

const mock = createMockModel({
responses: [
{ content: [{ type: "toolCall", id: "tool-1", name: "echo", arguments: { value: "hello" } }] },
{ content: ["done"] },
],
});
const config: AgentLoopConfig = { model: mock.model, convertToLlm: identityConverter };

const events: AgentEvent[] = [];
const stream = agentLoop([createUserMessage("echo something")], context, config, undefined, mock.stream);

for await (const event of stream) {
events.push(event);
}

// Tool should have been executed
expect(executed).toEqual(["hello"]);

// Should have tool execution events
const toolStart = events.find(e => e.type === "tool_execution_start");
const toolEnd = events.find(e => e.type === "tool_execution_end");
expect(toolStart).toBeDefined();
expect(toolEnd).toBeDefined();
if (toolEnd?.type === "tool_execution_end") {
expect(toolEnd.isError).toBeFalsy();
}
});

it("surfaces validation error for malformed JSON parse sentinels without leaking __rawJson", async () => {
const toolSchema = type({ value: "string" });
const tool: AgentTool<typeof toolSchema, { value: string }> = {
Expand Down
21 changes: 0 additions & 21 deletions packages/agent/test/agent-side-request-context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,6 @@ describe("Agent — buildSideRequestContext", () => {
execute: async () => ({ content: [{ type: "text", text: "success" }], details: { value: "success" } }),
};

it("forwards the tool catalog for native providers", async () => {
await withNativeDialectEnv(async () => {
const agent = new Agent({
initialState: {
model,
systemPrompt: ["system"],
tools: [tool],
},
});

const context = await agent.buildSideRequestContext([
{ role: "user", content: [{ type: "text", text: "Q?" }], timestamp: Date.now() },
]);

expect(context.tools).toBeDefined();
expect(context.tools!.length).toBe(1);
expect(context.tools![0].name).toBe("test_tool");
expect(context.systemPrompt).toEqual(["system"]);
});
});

it("matches the main loop's native stable prefix", async () => {
await withNativeDialectEnv(async () => {
let mainContext: Context | undefined;
Expand Down
Loading
Loading
0