20 Commits

Author SHA1 Message Date
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
roboomp 619412c987 fix(memory): hid disabled memory protocol
Made the Read schema session-aware and rejected memory URLs when the calling session has memory disabled.

Fixes #7673
2026-08-05 04:07:40 +00:00
can1357 d53d5c0035 fix(coding-agent): scope hindsight memory errors to caller 2026-08-05 01:12:01 +02:00
roboomp 8b152f7bdf fix(coding-agent): give memory:// a corrective error under hindsight backend
The shared `recall` tool description instructs a follow-up `read memory://<id>`,
but the memory:// handler resolves only `root` and mnemopi ids. Under
memory.backend=hindsight, following the tool's own docs hit the generic
"Unknown memory namespace" error that only mentions mnemopi, causing repeated
failed reads and derailment.

Make the handler backend-aware: when a memory://<id> read arrives while a
Hindsight session is active and no mnemopi state can serve it, throw a
corrective error pointing at `recall`/`reflect` so a stray read self-corrects
in one turn.

Fixes #7587
2026-08-04 03:42:57 +00:00
can1357 ccd3bb9565 chore: reformat 2026-07-30 04:25:32 +02:00
can1357 091f670ea0 style: apply biome formatting to merged changes 2026-07-30 01:28:07 +02:00
can1357 b849a4503f fix(coding-agent): kept encoded glob metacharacters literal in memory glob suffixes 2026-07-27 04:58:26 +02:00
usr-bin-roygbiv 49d5145fff fix(coding-agent): preserve encoded memory glob bases 2026-07-26 21:33:13 +00:00
usr-bin-roygbiv 6b65fd2996 fix(coding-agent): preserve question-mark memory globs 2026-07-26 20:58:33 +00:00
Roy 90cb91489e fix(coding-agent): safely glob memory directories 2026-07-26 16:36:47 +00:00
can1357 a9998ae07b Merge PR #5086: fix(agent): isolate memory root resolution (@roboomp)
# Conflicts:
#	packages/coding-agent/src/internal-urls/memory-protocol.ts
2026-07-14 18:41:54 +02:00
roboomp f26fffb8e0 fix(agent): isolated memory root resolution
Resolved file-backed memory://root URLs from the calling session cwd before falling back to the global registry.

Passed the caller cwd through bash internal-URL expansion so redirected memory paths cannot pick another live agent root.

Fixes #5079
2026-07-10 14:48:24 +00:00
roboomp a4f43be040 fix(coding-agent): rejected read-only internal url writes
Blocked write tool filesystem fallback for read-only internal URL schemes so memory:// targets cannot be materialized as project-relative paths.

Added a regression test covering memory://root/memory_summary.md writes and the leaked memory:/root path.

Fixes #5075
2026-07-10 14:18:53 +00:00
can1357 efc90d26b8 style: applied biome fixes to integrated issue fixes 2026-07-09 18:34:06 +02:00
can1357 ca68daa81c fix(mnemopi): made recall fact ids resolvable via memory reads
recall (includeFacts) surfaces facts.fact_id as a result id, but
store.get only searched working_memory + episodic_memory, so every
surfaced fact id was a dead end for 'read memory://<id>' and
memory_edit ('not found in any scoped bank').

- store.get now falls back to the facts table (visibility mirrors
  factRecall: same-session or scope='global'), returning a read-only
  row with memory_store 'fact' and the full triple as content.
- coding-agent labels the store honestly ('fact') in memory:// reads
  and reports not_editable (instead of not_found) for memory_edit ops
  on fact ids; the facts table stays immutable.

Fixes #4725
2026-07-09 18:27:23 +02:00
roboomp 536ecc725a fix(mnemopi): let agents read stored memories in full
Recall silently clipped every result to 500 chars mid-word with no marker,
and memory_edit update replaces content wholesale by id. There was no way
for an agent to inspect the full row before overwriting it: Mnemopi.get
existed but nothing surfaced it, and the advertised URI only served the
file-backed memory summary. The natural recall/inspect/update loop had no
inspect step.

Three fixes across mnemopi and coding-agent:
- recall now appends an ellipsis marker when it clips content and reports
  truncated=true plus full_length. The cap is exposed as
  RecallOptions.contentPreviewChars (default 500, 0 disables). The factLine
  200-char clip used by the enhanced-context sandwich gets the same marker.
- Under the mnemopi backend the read-tool URI scheme now routes an id host
  to Mnemopi.get() across every session's scoped banks, returning the row
  as text/markdown with a YAML-frontmatter header (bank, store, source,
  timestamp, importance, veracity). The root namespace remains for the
  file-backed summary. Miss errors now name the backend explicitly.
- Updated the recall and memory_edit tool prompts to document the
  truncation marker and require reading the full memory before any
  wholesale content update.

Fixes #4443
2026-07-03 15:05:43 +00:00
oldschoola a2854ba768 fix: migrate coding-agent tests from fs.rm to removeWithRetries
Migrate 203 test files (356 call sites) from fs.rm/fs.rmSync to
removeWithRetries/removeSyncWithRetries to reduce EBUSY test failures
on Windows. removeWithRetries is now exported from @oh-my-pi/pi-utils.

The migration uses a regex-based approach that:
- Replaces fs.rm(path, { recursive, force }) → removeWithRetries(path)
- Replaces fs.rmSync(path, { recursive, force }) → removeSyncWithRetries(path)
- Replaces fs.rm(path) → removeWithRetries(path) (no options)
- Skips fs.rm/fs.rmSync inside template literals (bun --eval scripts)
- Adds imports to existing @oh-my-pi/pi-utils import or creates new one
- Removes unused fs imports where fs.rm was the only fs usage (4 files)
2026-06-23 15:28:05 -07:00
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00
can1357 1bde755933 feat(coding-agent): added global singletons for URL protocol handlers
- Added process-wide singleton instances for InternalUrlRouter, AsyncJobManager, and MCPManager.
- Changed internal URL protocols to resolve through registered sessions and scan all active roots/datasets for matches.
- Refactored agent, artifact, memory, rule, skill, jobs, and mcp handlers to use shared manager and rule/skill state.
- Removed per-session protocol/tool wiring and switched tests to initialize and reset global singleton state.
2026-05-12 05:07:52 +02:00
can1357 ba1e3f8a07 fix(coding-agent): expanded internal url resolution and hardened memory protocol
Fixes #54
Fixes #74
2026-02-18 15:14:21 +01:00