@jc_stack/ez-agents 0.1.0-beta.25 → 0.1.0-beta.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/.env.example +1 -1
  2. package/AGENTS.md +15 -8
  3. package/CHANGELOG.md +19 -0
  4. package/CONTRIBUTING.md +3 -1
  5. package/README.md +5 -4
  6. package/docs/architecture/ai-selection.md +12 -15
  7. package/docs/docker-runtime.md +9 -0
  8. package/docs/host-service.md +5 -8
  9. package/docs/local-qa.md +1 -1
  10. package/docs/plugins.md +14 -1
  11. package/docs/releasing.md +3 -2
  12. package/docs/repair.md +26 -25
  13. package/docs/responsive-channels.md +13 -55
  14. package/docs/scheduling.md +40 -36
  15. package/docs/setup.md +11 -21
  16. package/docs/standalone-cli.md +2 -2
  17. package/docs/upgrades.md +32 -17
  18. package/package.json +2 -3
  19. package/src/agent-guidance.ts +32 -3
  20. package/src/ai-cli.ts +5 -1
  21. package/src/ai.ts +6 -28
  22. package/src/codex-session.ts +4 -9
  23. package/src/config.ts +3 -3
  24. package/src/control-state.ts +18 -6
  25. package/src/desktop-bridge.ts +11 -43
  26. package/src/executor.ts +20 -55
  27. package/src/host-executor.ts +4 -8
  28. package/src/index.ts +50 -45
  29. package/src/menu.ts +51 -47
  30. package/src/message-send.ts +1 -1
  31. package/src/message.ts +1 -0
  32. package/src/model-policy.ts +5 -15
  33. package/src/plugins/manager.mjs +31 -6
  34. package/src/repair-policy.ts +0 -8
  35. package/src/reply-context.ts +3 -29
  36. package/src/schedule-cli.ts +24 -11
  37. package/src/scheduled-tasks.ts +20 -21
  38. package/src/scheduler.ts +38 -15
  39. package/src/task-executor.ts +4 -5
  40. package/src/task-workspace.ts +2 -11
  41. package/src/update-attention.ts +1 -1
  42. package/src/updates/binding.mjs +2 -6
  43. package/src/updates/supervisor.mjs +10 -4
  44. package/src/workspace.ts +3 -1
  45. package/templates/agent/AGENTS.md +13 -55
  46. package/templates/agent-guidance.md +27 -30
  47. package/templates/failure-review.md +6 -0
  48. package/templates/maintainer-purpose.md +12 -6
  49. package/test/agent-guidance.test.ts +29 -39
  50. package/test/ai-cli.test.ts +9 -0
  51. package/test/ai.test.ts +66 -22
  52. package/test/busy-reply-relay.test.ts +11 -7
  53. package/test/client-defaults.test.ts +1 -1
  54. package/test/codex-session.test.ts +15 -10
  55. package/test/config.test.ts +1 -1
  56. package/test/desktop-bridge.test.ts +17 -11
  57. package/test/engine-handoff.test.ts +73 -0
  58. package/test/event-sources.test.ts +5 -8
  59. package/test/executor.test.ts +12 -16
  60. package/test/failure.test.ts +64 -0
  61. package/test/host-executor.test.ts +30 -17
  62. package/test/install-config.test.ts +1 -1
  63. package/test/intake-relay.test.ts +47 -24
  64. package/test/model-policy.test.ts +23 -48
  65. package/test/plugin-manager.test.mjs +36 -10
  66. package/test/repair-policy.test.ts +8 -12
  67. package/test/runs.test.ts +13 -0
  68. package/test/schedule-cli.test.ts +34 -5
  69. package/test/scheduled-tasks.test.ts +79 -8
  70. package/test/scheduler-relay.test.ts +25 -0
  71. package/test/scheduler.test.ts +30 -1
  72. package/test/task-native.test.ts +5 -2
  73. package/test/update-attention.test.ts +1 -2
  74. package/test/updates.test.mjs +5 -5
  75. package/test/workspace.test.ts +2 -3
  76. package/scripts/smoke-busy-reply.ts +0 -58
  77. package/src/reply-executor.ts +0 -55
  78. package/src/reply-mcp.ts +0 -23
  79. package/templates/agent/TOOLS.md +0 -105
  80. package/templates/chat-guidance.md +0 -23
  81. package/templates/standalone-tools.md +0 -20
  82. package/templates/updates.md +0 -45
  83. package/test/reply.test.ts +0 -159
package/.env.example CHANGED
@@ -26,7 +26,7 @@ EZ_EXECUTOR_CLI=agy
26
26
  # OPENCODE_MODEL=openrouter/nvidia/nemotron-3.5-lightning
27
27
 
28
28
  # Interactive Codex CLI context limit; native compaction preserves the session.
29
- EZ_CODEX_AUTO_COMPACT_TOKENS=64000
29
+ # EZ_CODEX_AUTO_COMPACT_TOKENS=64000
30
30
 
31
31
  # Automatic core/plugin repair mandate. Set in deployment docker.env for Compose.
32
32
  # Does not grant GitHub access, merge or publication permissions.
package/AGENTS.md CHANGED
@@ -11,6 +11,14 @@ Installed runtime operation uses Docker Compose. Read
11
11
  [Docker setup, state and QA](docs/docker-runtime.md). Docker owns relay/plugin services; the existing host CLI and login are shared
12
12
  through one generic transport, with separate agent workspaces and sessions.
13
13
 
14
+ ## General core instructions
15
+
16
+ When the owner refers to "general core instructions", they mean
17
+ `templates/agent-guidance.md`, loaded from the installed package into CLI and
18
+ desktop agent runs, including background tasks. Update that file for defaults
19
+ that must reach all agents after upgrade. Workspace `AGENTS.md` files and
20
+ `templates/agent/` seeds alone do not propagate changes to existing agents.
21
+
14
22
  ## Installing this package
15
23
 
16
24
  When the user asks to set up or install this repository or package, follow
@@ -37,14 +45,13 @@ This package will be published as an open-source, lightweight Telegram-to-CLI re
37
45
  - **Native Node 22+ APIs only:** Use `node:fs/promises`, `node:child_process`, `node:crypto`, `node:path`, and native global `fetch`, `FormData`, and `Blob`.
38
46
  - Keep `node_modules` minimal and installable in seconds.
39
47
 
40
- ## 2. Zero Deterministic Coding Across the Board (Tools, Flows & Dialog)
41
- - **The relay is dumb plumbing:** The relay only ingests messages, batches them into runs, spawns the CLI executor, and drains outbox items. It is strictly minimal.
42
- - **Nothing deterministic—not just dialog:** Do not hardcode multi-step tool pipelines, fallback state machines, parameter translation shims, procedural dialog flows, or canned conversational receipts ("Started run...", "I'll message as I go...").
43
- - **The debugging reflex trap:** When an integration, tool, or flow doesn't work as expected, developers and LLMs have an overwhelming reflex to patch it by writing deterministic procedural code (`if error X -> hardcode Y -> do Z`). **Resist this completely.**
44
- - **The real engineering work:** Our job is solely to:
45
- 1. Build clean, standalone tools that work reliably with clear Unix interfaces (clear args, predictable stdout/stderr, clean exit codes).
46
- 2. Ensure tools have simple setup and are clearly explained in the agent's workspace so the **agent understands them**.
47
- 3. Let the agent own all flow orchestration, tool chaining, decision making, and error recovery. Question every line of code—if it can be agentic, keep code out of it.
48
+ ## 2. The engine is the core; ez is an ultra-lean gate
49
+ - The selected CLI/GUI engine owns intelligence, context, reasoning, planning, goals, delegation and continuation. ez mainly authorizes inputs, invokes engines/tools and transports results. Keep necessary queue ownership, cancellation, secret isolation and reliable delivery deterministic.
50
+ - Plugins are ordinary CLI tools with explicit inputs, outputs and errors. Packaging a tool does not justify another LLM worker or business workflow owner.
51
+ - **SUBTRACT is as valid as ADD.** Question the requirement; delete unnecessary behavior; simplify; shorten feedback; automate last. Name and try the subtraction option before proposing additions. Removing a wrapper or correcting existing engine instructions/tool contracts can be the complete fix.
52
+ - Add code only for a demonstrated missing transport or tool capability. Prompts, agents, retries and lifecycle owners also count as machinery; do not replace deleted code with a scripted prompt workflow. Prefer existing engine, CLI and Docker capabilities.
53
+ - `/goal do my daily routine` is literal task-prompt text for the engine. ez does not parse it, construct a native objective or own its workflow.
54
+ - Keep changes focused. State what was removed, why anything added is necessary, and which observed outcome proves the simpler system works. Preserve authority and uncertain-delivery safeguards. Unchanged, non-actionable maintenance stops quietly; queued updates and passing tests alone do not prove an installed fix.
48
55
 
49
56
  ## 3. Crash-Safe Atomic Disk State
50
57
  - All persistent stores (`ControlStore`, `RunStore`, outbox queue) must be disk-backed JSON files.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-beta.27
4
+
5
+ - Pass literal task input and `/goal` requests to the selected engine; remove
6
+ workflow prompt assembly and transport-owned goal creation.
7
+ - Slim shared instructions and discover installed plugin guidance on demand.
8
+ - Let engines own concurrent execution instead of reserving shared workspaces
9
+ for entire runs. Preserve authorization, request ownership and cancellation.
10
+ - Clarify chat delivery and acknowledgement through the bound message CLI,
11
+ and decode inline newline escapes in messages.
12
+ - Show active scheduled-task details and simplify AI selection in Telegram.
13
+ - Stop self-feeding maintenance and keep optional transport failures isolated.
14
+
15
+ ## 0.1.0-beta.26
16
+
17
+ - Start local software-maintenance wakeups in independent ephemeral sessions,
18
+ including after a relay restart, without trying to resume or persist a
19
+ normal owner conversation. This prevents successful upgrades from producing
20
+ false "failed to start" notifications across direct relays.
21
+
3
22
  ## 0.1.0-beta.25
4
23
 
5
24
  - Enable Codex Luna `max` reasoning for durable work, schedules and deferred
package/CONTRIBUTING.md CHANGED
@@ -8,7 +8,9 @@ repository. Public docs describe shipped behavior and explicit limitations.
8
8
  1. Start one coherent change in a dedicated worktree from fetched origin/main,
9
9
  following the isolated-work rules below. Preserve unrelated work.
10
10
  2. Install Node 22+ and pnpm 10.30.3. Run `pnpm install --frozen-lockfile`.
11
- 3. Change the code, user instructions and focused tests together. Authority,
11
+ 3. Apply AGENTS.md’s KISS change gate: identify the failed boundary, remove
12
+ unnecessary behavior first, and explain why remaining code is needed. Change
13
+ the code, user instructions and focused tests together. Authority,
12
14
  paths, credentials, cancellation and uncertain writes need negative tests.
13
15
  4. Run `pnpm verify`, `npm run release:check` and `git diff --check`.
14
16
  Packaging/runtime changes also need the Docker checks in docs/releasing.md.
package/README.md CHANGED
@@ -120,8 +120,9 @@ does not receive their executor or provider credentials.
120
120
 
121
121
  Telegram `/status` shows the running relay and host versions plus installed
122
122
  plugin versions. Its read-only **Scheduled tasks** control lists the paired
123
- owner's saved task titles, instructions, timing, state and next run; it never
124
- creates, changes or runs a task. The agent's `ez status` adds verified plugin
123
+ owner's active schedules in alphabetical order, with their engine/model/effort,
124
+ next occurrence or current queued/running state, and a short preview of the
125
+ saved invocation prompt; it never creates, changes or runs a task. The agent's `ez status` adds verified plugin
125
126
  runtime states and upgrade job receipts. See [status and upgrades](docs/upgrades.md).
126
127
 
127
128
  ## You are the installing agent
@@ -205,8 +206,8 @@ restart and shutdown. The installing agent registers the small host CLI transpor
205
206
 
206
207
  The selected host CLI runs in this agent's persistent workspace and owns its
207
208
  Markdown/work files. New conversations and AI changes preserve those files.
208
- `AGENTS.md`, `SOUL.md`, `USER.md`, and `TOOLS.md` are seeded; `MEMORY.md` is
209
- optional. Received files go in `inbox/`, tasks and deliverables in `work/`.
209
+ `AGENTS.md`, `SOUL.md`, and `USER.md` are seeded; `MEMORY.md` is
210
+ optional. Installed plugin snippets and skill paths come from `ez tools list --details`; no tool inventory file needs maintenance. Received files go in `inbox/`, tasks and deliverables in `work/`.
210
211
  Credentials and control state stay outside the mind. File separation is not
211
212
  OS isolation against a process running as the same user.
212
213
 
@@ -28,8 +28,11 @@ offer their own default only in this slice. Refresh by opening the native client
28
28
  the relay does not install models, manage subscriptions or guess aliases.
29
29
 
30
30
  Setup initialization and relay startup seed one default choice per installed client.
31
- Choose AI opens the available installed-model catalog directly; Settings keeps
32
- saved choices and Refresh available AIs repeats default discovery. Active/default
31
+ Choose AI shows the three most recent valid choices and installed clients, then
32
+ the selected client's models and reasoning levels. Selecting a model and reasoning
33
+ level applies that choice immediately. The retired Settings control points to
34
+ Choose AI; application-backed channels keep these controls in their application.
35
+ Refresh available AIs repeats default discovery. Active/default
33
36
  presets and queued snapshots are preserved; discovery only refreshes unused
34
37
  detected entries.
35
38
  Codex uses its native `config/read` interface; Grok reads its documented user
@@ -38,17 +41,11 @@ workspace JSON settings; OpenCode reports resolved config. Unknown defaults and
38
41
  opaque wrappers remain explicitly “client default”. No credentials are stored,
39
42
  no inference runs, no new dependency, and no cross-CLI session transfer.
40
43
 
41
- New Codex CLI and desktop agents seed **Responsive chat** (`gpt-5.6-sol`,
42
- `medium`). Durable work keeps its independent `gpt-5.6-luna` / `max` default;
43
- workers can explicitly select another model and effort for the job. Native
44
- choices for other executors remain unchanged. No fallback is selected when a
45
- model is unavailable.
44
+ New agents leave model/effort unset for native configuration to resolve. Captured
45
+ and explicitly saved choices are preserved; schedules inherit the selected engine
46
+ settings unless overridden. There are no hardcoded chat/worker models or reasoning
47
+ caps. Explicit OPENCODE_MODEL remains supported.
46
48
 
47
- Upgrades add the responsive preset to the menu without changing an existing
48
- selection, default, session, or queued run. Choose it through Choose AI for the
49
- current conversation or Settings for future conversations. `/status` shows the
50
- saved selection. Legacy client-default seeds still use native configuration
51
- metadata for display only.
52
-
53
- See [responsive channels](../responsive-channels.md) for the conversational
54
- policy and the separate boundaries for plugin correspondence and app backends.
49
+ Restricted sessions intentionally ignore unrestricted user configuration and use
50
+ isolated native defaults when no choice is supplied. See [responsive channels](../responsive-channels.md)
51
+ for their scoped tool and authority boundaries.
@@ -153,3 +153,12 @@ its polling delay in executor duration; it is not a pure model-inference measure
153
153
  Delivery processing includes pacing, media preparation and provider calls. A sent
154
154
  message may precede executor exit. No prompt, message body or credentials are added
155
155
  to these timing logs.
156
+
157
+ ### Polling faults
158
+
159
+ Permanent errors escaping Telegram setup/polling (including unauthorized tokens,
160
+ competing pollers and programming errors) stop relay-level retry until explicit
161
+ restart after repair. Existing authorized work and outbox draining remain active;
162
+ polling health remains unhealthy. Transient HTTP, rate-limit and server errors
163
+ may reconnect. grammY still owns reconnect behavior inside its poller; ez does
164
+ not override private library methods or implement a replacement poller.
@@ -88,12 +88,9 @@ preserving it rather than reverting to a different or expired host login.
88
88
 
89
89
  An agent binding may set `sharedWorkspace` to an absolute canonical application
90
90
  repository. The host resolves its canonical path, adds that directory to Codex
91
- write permissions for chat and scheduled jobs, and serializes all bindings in
92
- that host executor which share it (including symlink aliases). Task sessions and
93
- artifacts remain isolated. This is useful when independent task folders still
94
- write the same application records. Long jobs can delay chat execution; relay
95
- intake and cancellation remain available. The binding is host-owned and cannot
91
+ write permissions for chat and scheduled jobs, including symlink aliases.
92
+ The host claims requests independently; a running job does not block another
93
+ request sharing its workspace. The selected engine owns execution concurrency.
94
+ Task sessions and artifacts remain isolated. The binding is host-owned and cannot
96
95
  be supplied by a queued request. Other executors keep their native filesystem
97
- policy. This lock is scoped to one host executor process; it does not coordinate
98
- separate deployments or external writers. Do not run a second controller against
99
- that repository.
96
+ policy. Shared workspace access does not provide exclusive file ownership.
package/docs/local-qa.md CHANGED
@@ -20,7 +20,7 @@ package version and `ezQa` provenance metadata differ from the source npm packag
20
20
  Do not publish these private archives. Each new candidate gets a new label and a
21
21
  version newer than the PA's installed version; labels are never overwritten.
22
22
 
23
- Add the catalog path and the following instructions to the PA's local TOOLS.md:
23
+ Add the catalog path and the following instructions to the PA's local policy file, linked from AGENTS.md:
24
24
 
25
25
  > When the owner requests a beta number, first inspect the matching beta-N entry
26
26
  > in the local QA catalog. Read manifest.json and QA.md. Check the archive SHA-256
package/docs/plugins.md CHANGED
@@ -28,7 +28,7 @@ Without `--catalog`, init loads an empty packaged catalog. Keep it empty for
28
28
  initial main onboarding; no sibling repository, broker or provider account is
29
29
  needed. Finish owner pairing and verify an actual Telegram agent reply first.
30
30
  Init creates a private registry and `tools/bin/ez`, adds a
31
- TOOLS.md discovery entry, and binds the matching host executor to that bin
31
+ managed AGENTS.md registry locator, and binds the matching host executor to that bin
32
32
  folder. Native binaries are linked through; an existing `ez` collision fails.
33
33
  Run before starting the host executor. For an already running installation,
34
34
  place a symlink to the returned launcher in that agent's existing private bin
@@ -294,3 +294,16 @@ disabled for that source. Enable the normal shared embedding worker through
294
294
  and original readback from the actual executor. Document any differences between
295
295
  indexed snapshots and current originals; do not replace Library with private
296
296
  QMD runtimes or edit installed Compose/package files to bypass missing support.
297
+
298
+ ## Generated capability discovery
299
+
300
+ `ez tools list --details` generates a compact index directly from installed
301
+ `ez-plugin.json` manifests: each plugin supplies its `description`, command aliases
302
+ and `skills`. Descriptions are limited to 200 characters in this view; full
303
+ instructions stay in the skill. Installation, replacement and removal are reflected
304
+ on the next read, without hooks, LLM calls or a cached inventory file.
305
+
306
+ `ez tools list` retains its alias mapping for existing clients. Native AGENTS.md
307
+ contains only the agent-bound discovery shortcut. New workspaces do not seed
308
+ TOOLS.md; upgrades preserve legacy notes without rewriting them. Keep owner/account
309
+ policies in agent instructions or linked policy files, separate from plugin metadata.
package/docs/releasing.md CHANGED
@@ -17,8 +17,9 @@ separate release bot is not required.
17
17
  3. Build both Docker targets from a clean checkout:
18
18
  `docker build --target test -t ez-release-tests .` and
19
19
  `docker build --target runtime -t ez-release-runtime .`.
20
- Main: `EZ_RELAY_IMAGE=ez-release-runtime node docker/smoke.mjs`.
21
- WhatsApp: `EZ_WHATSAPP_IMAGE=ez-release-runtime node docker/smoke.mjs`.
20
+ Main relay: `EZ_RELAY_IMAGE=ez-release-runtime node docker/smoke.mjs`.
21
+ The WhatsApp Compose overlay has no separate relay image; verify its
22
+ provider integration with the synthetic plugin smoke in `docs/plugins.md`.
22
23
  4. Create an artifact with `npm pack --ignore-scripts`. Inspect its file list,
23
24
  hash it, extract into a fresh directory, copy `docker/pnpm-lock.yaml` to
24
25
  `pnpm-lock.yaml`, and run `pnpm install --frozen-lockfile`.
package/docs/repair.md CHANGED
@@ -1,41 +1,42 @@
1
1
  # Native repair ownership
2
2
 
3
- Every deployed agent is a repairer by default. When an agent finds a core or
4
- plugin defect, it keeps the context and pursues a tested contribution PR. The
5
- core injects the same mandate into CLI/native and desktop execution, including
6
- existing workspaces; it does not replace the agent's mind or implement a repair
7
- workflow engine. Use native Git/GitHub CLI or the installed GitHub plugin.
3
+ Repair is a capability used by an explicit owner request or owner-saved maintenance
4
+ mandate. Discovering a defect alone does not enroll an ordinary conversation in
5
+ an issue/claim/PR workflow. Preserve useful evidence and continue the requested
6
+ task. The current execution guidance supersedes older default-repair text in
7
+ existing workspaces without rewriting the agent's mind.
8
8
 
9
- The agent searches for the same cause, registers a sanitized issue, requests a
10
- claim, then works in an isolated contribution checkout after the coordinator's
11
- grant. It resumes the same issue/branch/PR after interruption. The installed
12
- runtime is never the repair checkout. Missing credentials or coordination remain
13
- recorded blockers; the default does not invent repository access. Public reports
14
- must exclude private runtime data and use the security reporting route when needed.
9
+ For an authorized repair, use the selected engine with native Git/GitHub tools
10
+ and follow the target repository's CONTRIBUTING.md. Check existing work for the
11
+ same cause and use an isolated contribution checkout; never edit the installed
12
+ runtime as the repair checkout. Resume the same branch/PR after interruption.
13
+ A separate issue, claim service or coordinator grant is not an ez prerequisite.
14
+ Use coordination only where the repository or owner explicitly requires it.
15
15
 
16
- One coordinator grants claims sequentially per repository. Assignment alone is
17
- not a lock. All participating agents must use that coordinator; this convention
18
- cannot prevent an unrelated public contributor from opening a competing PR.
19
- The discovering agent remains the repairer, including when its work moves to a
20
- background task. The coordinator reconciles duplicates and stalled claims. The
21
- maintainer independently reviews and tests, then merges/publishes only within
22
- separate owner-approved policies. Start from templates/maintainer-purpose.md.
16
+ Question the failing wrapper before adding code. Removing behavior or correcting
17
+ existing instructions/tool contracts can fully resolve the defect. Preserve
18
+ useful evidence and verified outcomes, with normal independent review and CI.
19
+ Missing credentials block only operations requiring them; continue useful local
20
+ work and report the precise remaining dependency. Public reports must exclude
21
+ private runtime data and use the security reporting route where appropriate.
22
+ Do not repeatedly check an unchanged dependency.
23
23
 
24
24
  ## Disable
25
25
 
26
26
  Set `EZ_REPAIR_ENABLED=false` in the deployment's Docker environment and recreate
27
27
  the relay. The resolved setting crosses the host transport and is included in
28
28
  every new execution prompt; the default is true and invalid values fail startup.
29
- This changes the automatic mandate, not filesystem/GitHub permissions, and does
29
+ True makes the capability available; it does not itself grant a repair mandate.
30
+ The setting does not change filesystem/GitHub permissions and does
30
31
  not cancel an already running task. Explicitly stop active repair work when needed.
31
32
  An owner can also disable repairs globally or for a repository in the agent's
32
33
  saved USER.md preferences; carry those restrictions into background task context.
33
34
 
34
35
  ## Setup boundary
35
36
 
36
- The shipped mandate and maintainer purpose do not provision a GitHub account,
37
- coordinator service or publishing token. Enroll the allowed repositories and
38
- configure one maintainer execution lane on the owner's host before unattended
39
- claims. Reuse authenticated GitHub CLI where authorized. Repository push and PR
40
- permissions are distinct from package-registry publication and protected-branch
41
- approval. Never put credentials in prompts, issues or test environments.
37
+ Reuse existing authenticated access within the owner's request or saved mandate.
38
+ ez does not provision a coordinator, GitHub identity or publishing token, and
39
+ none is an implicit prerequisite for local diagnosis or an authorized local fix.
40
+ Repository push/PR access, protected-branch review and package publication are
41
+ separate capabilities and permissions. Follow existing release authority; never
42
+ put credentials in prompts, issues or test environments.
@@ -1,57 +1,15 @@
1
1
  # Responsive channels
2
2
 
3
- Ez treats conversational channels as places to answer, clarify and hand off
4
- work. A simple question uses the current conversation; a small authorized action
5
- uses its canonical receipt. Substantial work gets a durable task with enough
6
- context to finish and verify the job. The agent returns to conversation after
7
- the handoff is saved, instead of waiting for the worker. This is agent guidance,
8
- not a keyword classifier, automatic acknowledgement, or latency guarantee.
9
-
10
- New Codex agents use Sol / medium for chat. Scheduled work defaults independently
11
- to Luna / max; the agent can choose another model and effort for complex work.
12
- `ezenciel-agents-schedule create --now --text-file FILE --model MODEL --effort max`
13
- uses the existing scheduler (include `--name` for a useful task label). Busy owner
14
- reply sessions expose the same independent model/effort choice through `defer`.
15
- Its retry returns the first saved schedule; changing arguments does not revise
16
- an accepted job. `xhigh` and `max` are available only for Luna; other models remain capped at high.
17
-
18
- A handoff includes the objective, relevant context and paths, constraints,
19
- authorized actions, acceptance checks and delivery destination. Background
20
- sessions own verification and final delivery, and may use native subagents.
21
- One writer per workspace still applies. Shared external resources require
22
- coordination even when task directories differ. Status must distinguish a saved
23
- schedule from actual execution and a verified result from a process exit.
24
-
25
- The package loads `templates/chat-guidance.md` at each turn for CLI, desktop,
26
- busy owner replies and approved plugin messaging tasks. Upgrades refresh this
27
- behavior without rewriting the agent's personal files. Existing model choices
28
- remain pinned; an upgrade adds Responsive chat as an available selection.
29
-
30
- ## Channel and authority boundaries
31
-
32
- Telegram owner conversations can schedule work under the owner's authority.
33
- The existing restricted busy-reply session keeps Codex chat available while a
34
- writer is active. Other executors retain their existing concurrency behavior.
35
-
36
- WhatsApp and other plugin contacts use the approved messaging task's isolated
37
- context and tools. They receive the conversational guidance and Sol / medium
38
- selection, but cannot invoke owner schedules, shell tools or native subagents.
39
- They report work outside their capabilities to the owner; that report is not
40
- an instruction or permission to execute. Full delegation from a plugin contact
41
- needs an explicitly scoped worker capability and return route; this update does
42
- not grant one. The plugin name alone never confers owner authority.
43
-
44
- An application using `channelBackendUrl` owns its conversation, model and job
45
- lifecycle. The relay does not inject prompts or override the app's model. Such
46
- backends (including AI Fit) must adopt the same handoff policy in their own
47
- runtime to benefit. Reuse their canonical job system; do not create a second
48
- agent in the transport. Telegram polling and app-side queue waits still count
49
- toward user-visible latency.
50
-
51
- ## Verification
52
-
53
- Tests cover independent worker settings, preserved selections across upgrades,
54
- idempotent handoffs, invalid settings, revocation and restricted tool boundaries.
55
- Existing scheduler/host tests cover a conversational reply while work remains
56
- active. Measure time to the first useful reply and verified task completion
57
- separately on the deployed provider before claiming a performance improvement.
3
+ Owner input passes unchanged to the selected engine. The agent decides when to
4
+ delegate or schedule long work to remain available. ez queues foreground input
5
+ while a foreground run is active; it does not create a separate busy-reply agent.
6
+ Independent scheduled task directories retain deterministic writer isolation.
7
+
8
+ Background tasks receive literal task text. Their directories contain no generated
9
+ role instructions or copied identity files; native workspace instructions and
10
+ existing Markdown provide context. The agent chooses what to read and when to use
11
+ the message CLI. Native final text is not automatically delivered to Telegram.
12
+
13
+ Restricted correspondence receives a typed activation event and scoped tools.
14
+ Authorization, sandboxing and tool handlers enforce contact and lifecycle limits.
15
+ Maintenance and group notifications carry event data; CLI help owns operations.
@@ -32,30 +32,26 @@ the host changes zones. Nonexistent DST wall times are skipped; repeated wall
32
32
  times fire once, at the earlier instant. Search is bounded to eight years.
33
33
  Public-holiday calendars and arbitrary RRULE syntax are not implemented.
34
34
 
35
- New tasks, including work deferred by a busy reply session, default to Codex
36
- `gpt-5.6-luna` with `max` reasoning independently of the creating chat.
37
- New chats use the separate Sol/medium preset. Busy reply `defer` accepts optional
38
- `model` and `effort` fields; retries preserve the first saved task choice.
39
- Use `--cli`, `--model`, and `--effort` to specify another choice. `xhigh` and
40
- `max` are available only with Codex `gpt-5.6-luna`; every other model remains capped at
41
- `high`. Non-Codex adapters inherit native effort when unset. Editing preserves the existing AI
42
- choice unless those flags override it. Stored choices are checked again at
43
- launch, including schedules saved before a policy change.
35
+ New tasks inherit selected engine settings. Explicit `--cli`, `--model` and
36
+ `--effort` override those choices; omitted values use native defaults. Edits
37
+ preserve existing choices. Historical deferred tasks keep their source context
38
+ available through `ezenciel-agents-schedule context`.
44
39
 
45
40
  ## Execution and authority
46
41
 
47
- The relay checks due work once per second. Each occurrence enters the durable
48
- run queue with a stable ID. Background work runs in a fresh native CLI session
49
- and `work/tasks/RUN_ID/`, with snapshots of the agent's SOUL, USER and TOOLS files.
50
- Instructions must include any needed context or source paths; full chat history
51
- is not copied. Task folders remain for inspection and artifact delivery.
42
+ Due occurrences enter the durable queue with stable IDs and literal task text.
43
+ Background runs use fresh native sessions in `work/tasks/RUN_ID/`. No identity
44
+ files or role instructions are generated there. Existing workspace Markdown
45
+ provides context; the engine chooses what to read. Codex uses `AGENTS.md` or `.git`
46
+ as its native project-root marker, so a nested task sees the existing agent scope. Task folders remain for
47
+ inspection and artifact delivery.
52
48
 
53
49
  One writer runs per task directory. Up to four background tasks can run alongside
54
- the main conversation. When a Codex owner message arrives while work is busy, a separate restricted session reads recent messages and run progress and answers through the normal outbox. It can queue requested work through the scheduler, but cannot run shell commands, access plugins, or edit the agent workspace. Only one reply session runs at a time and it releases its slot after a 60-second reply deadline; this deadline does not apply to writer jobs. Its context is a bounded snapshot, not a shared native transcript. Delivered parallel replies are included as historical context in the next normal conversation turn. Codex 0.153.4 and 0.154.0 are supported for this restricted adapter. Other versions fail closed pending tool-surface validation. A recurring schedule has at most one pending
55
- or active occurrence. Agents should delegate long work with `create --now`, return
56
- to chat, and inspect `runs` or task progress when asked. Native subagents can be
57
- used inside the worker. Sharing provider profiles does not make concurrent CRM,
58
- file or browser writes safe: the agent must coordinate those resources.
50
+ the main conversation. Foreground inputs queue while a foreground turn runs;
51
+ ez does not create another reply agent. The agent can delegate or schedule long
52
+ work and return to chat. It decides when to send through the message CLI.
53
+ A recurring schedule has at most one pending or active occurrence. Shared
54
+ provider resources still need writer coordination.
59
55
 
60
56
  Production relay/host execution has no wall-clock timeout. The old
61
57
  `EZ_EXECUTOR_TIMEOUT_SECONDS` setting is ignored. Individual network/tool waits
@@ -64,13 +60,14 @@ are an executor capability, configured through instructions. Ez has no goal API,
64
60
  continuation loop or rule equating a process exit with goal achievement.
65
61
 
66
62
  Scheduled Codex CLI tasks use a dedicated native app-server session, tested with
67
- CLI 0.153.4. A leading `/goal` in the instruction text maps to the same native
68
- goal command used by the interactive CLI. Codex automatically starts subsequent
69
- turns; the transport stays connected until the native goal is complete or stops
70
- for attention. It sends no continuation prompts and stores no Ez goal state.
71
- Goals created by the agent's native tools also keep the session alive. Ordinary
72
- tasks finish after their turn. A blocked, paused or limited goal is not reported
73
- as successful. Native RPC requests have a response deadline; running tasks do not.
63
+ CLI 0.153.4. Ez forwards the full task as ordinary input without interpreting
64
+ `/goal` or constructing a native goal objective. The engine handles the request,
65
+ context and native goal creation. Codex owns continuation; the transport stays
66
+ connected while a native goal is active and verifies its terminal state. It sends
67
+ no continuation prompts and stores no Ez goal state. Ordinary tasks finish when
68
+ the engine completes its turn without an active goal. A blocked, paused or limited
69
+ goal is not reported as successful. Native RPC requests have a response deadline;
70
+ running tasks do not.
74
71
  Each scheduled task has its own Codex state under `control/cli/codex/tasks/RUN_ID`,
75
72
  with a snapshot of the agent's Codex configuration and the existing auth link.
76
73
  Foreground chat and background tasks do not initialize or migrate one shared
@@ -109,6 +106,15 @@ artifacts are retained. The agent sends through the normal Telegram outbox;
109
106
  `completed` means executor exit, while provider delivery is recorded separately.
110
107
  A timeout or ambiguous send must not cause blind replay of the whole task.
111
108
 
109
+ ## Failure-review stop
110
+
111
+ A schedule using `--when unreviewed-failures` stops dispatching its current
112
+ revision after one of its own runs fails. The failed receipt remains available
113
+ through `runs`/`run`; no new retry queue or automatic repair task is created.
114
+ The paired owner or authorized maintainer diagnoses it and explicitly edits the
115
+ schedule to resume. Marking the failure reviewed or pause/resume alone does not
116
+ clear the stop. Ordinary recurring tasks retain their existing failure behavior.
117
+
112
118
  ## QA
113
119
 
114
120
  `pnpm verify` covers recurrence/DST, restart deduplication, authority revocation,
@@ -136,16 +142,6 @@ exercise cancellation, downtime catch-up and an explicitly requested native goal
136
142
  that needs more than one turn. Synthetic provider evidence does not prove real
137
143
  Telegram delivery, and a sleep test does not prove native goal persistence.
138
144
 
139
- Busy-chat regression probe (real Codex, synthetic Telegram):
140
-
141
- ```sh
142
- pnpm exec tsx scripts/smoke-busy-reply.ts --transport
143
- ```
144
-
145
- The probe holds a writer on a shared workspace, asks an owner question through
146
- the relay and host transport, and requires the restricted reply to complete
147
- while the writer remains active. It sends no real Telegram messages.
148
-
149
145
  ## Optional failure review
150
146
 
151
147
  Create a normal recurring schedule with `--every-seconds 900 --when unreviewed-failures --text-file templates/failure-review.md`. The condition advances empty occurrences without launching an executor. It considers only failures belonging to the paired owner. No separate monitor or automatic retry is introduced.
@@ -153,3 +149,11 @@ Create a normal recurring schedule with `--every-seconds 900 --when unreviewed-f
153
149
  `failures [--all] [--limit N]` returns failedAt, reason, exit code, native session, captured error and runtime versions. Capture keeps at most 4 KiB of redacted stderr; historical failures are not backfilled. `run RUN_ID` reads an owned run. `review RUN_ID --failed-at ISO --status resolved|attention --diagnosis TEXT --recovery TEXT --outcome TEXT` records the investigation without rewriting execution history. A stale timestamp is rejected; a later failure needs a new review. Restricted reply, external and isolated-task callers cannot review failures. An attention review is handed off, not repeatedly relaunched; another new failure wakes the next review.
154
150
 
155
151
  The prompt controls diagnosis, authorized recovery and quiet notification behavior. Inspect prior effects and receipts before retrying anything. A failed review run itself remains visible as a new failure for the next occurrence.
152
+
153
+ The Telegram Scheduled tasks menu lists enabled schedules that still have a pending
154
+ occurrence or a queued/running occurrence. Finished one-time tasks, paused
155
+ schedules and revisions stopped for review are hidden. Each entry shows the
156
+ effective engine/model/effort, next occurrence in UTC (or queued/running state),
157
+ and the first sentence of its saved invocation
158
+ prompt, limited to 140 characters. This is a read-only view; history and full
159
+ prompts remain available through the scheduling CLI.
package/docs/setup.md CHANGED
@@ -52,26 +52,16 @@ owner request for standalone plugin development is a separate workflow.
52
52
 
53
53
  ## Defaults and host prerequisites
54
54
 
55
- New agents using `codex` or `codex-gui` start with `gpt-5.6-sol` and `medium`
56
- reasoning, including when initialized with `ezenciel-agents-setup init`. This
57
- Ez default takes precedence over discovered host client defaults. Saved agent
58
- selections permitted by the current policy are preserved; use the AI settings to choose another model or effort.
59
- Ez accepts `xhigh` and `max` only for `gpt-5.6-luna`; every other model rejects explicit
60
- reasoning above `high` at selection and execution, including old saved or queued choices.
61
- Unset Codex model/effort resolves to
62
- Luna/max at launch. This governs Ez-managed launches; it is not an account-wide
63
- limit on independently launched native clients or executor-created native subagents.
64
- Other adapters inherit their native effort when none is selected in Ez. That
65
- inherited configuration is not capped by Ez; explicit above-high Ez selections
66
- are rejected unless they are Codex Luna/xhigh or Luna/max. Conversation presets pin Sol/medium; the lower-level
67
- Codex fallback is Luna/max for work without an explicit choice.
68
-
69
- New scheduled and one-off background tasks default to Codex Luna/max independently
70
- of the creating chat. Use scheduler `--cli`, `--model`, and `--effort` flags for
71
- explicit overrides. Editing a schedule preserves its settings unless overridden.
72
- Restricted messaging tasks use Sol/medium while retaining their approved tool
73
- and context boundaries. Upgrades add Responsive chat to saved choices without
74
- replacing the selected/default preset. See [responsive channels](responsive-channels.md).
55
+ New agents use the selected engine's native model and effort unless a choice is
56
+ explicitly saved. Scheduling inherits the selected engine settings; `--cli`,
57
+ `--model` and `--effort` provide explicit overrides. Edits preserve saved choices.
58
+ The installed client's catalog supplies supported choices; ez imposes no model-specific
59
+ reasoning cap. Optional compaction settings are passed only when explicitly configured.
60
+
61
+ Restricted correspondence and busy replies retain their audited Codex adapter and
62
+ isolated tool permissions. They honor explicit model/effort choices; unset values
63
+ use that isolated client's native defaults. Unrestricted user configuration is
64
+ not imported into restricted sessions. No workflow prompt is added to input.
75
65
 
76
66
  Use the existing owner's host account. Unless a layout was supplied, use
77
67
  `${XDG_DATA_HOME:-$HOME/.local/share}/ez/packages/<version>/` for extracted main
@@ -199,7 +189,7 @@ node /absolute/ezenciel_agents/bin/ezenciel-agents-tools.mjs init \
199
189
  This binds a private `ez` and preserves native command access. The default catalog
200
190
  is empty. Do not supply a plugin catalog during first-time main onboarding.
201
191
  Initialization
202
- adds discovery instructions to the mind's TOOLS.md. Verify `tools/bin/ez plugins
192
+ adds discovery instructions to the mind's AGENTS.md. Verify `tools/bin/ez plugins
203
193
  available` before the first agent turn. Also execute the agent-bound
204
194
  `ezenciel-agents-message --help` through the selected CLI sandbox and verify
205
195
  its actual tool output, so absent launchers or blocked execution are detected
@@ -23,12 +23,12 @@ node /absolute/package/bin/ezenciel-agents-tools.mjs init --standalone \
23
23
  ```
24
24
 
25
25
  Init starts nothing, uses an empty catalog by default, preserves existing
26
- TOOLS.md notes and appends the registry's discovery instructions. A registry
26
+ workspace notes and adds a managed registry locator to AGENTS.md. A registry
27
27
  cannot be replaced by rerunning init. Keep the package at its original path:
28
28
  the launcher imports it. Status reports `main: null` without a relay binding;
29
29
  automated software upgrades currently require a relay deployment.
30
30
 
31
- Have each executor read the workspace's TOOLS.md and the installed plugin skills.
31
+ Use `ez tools list --details` for generated installed-plugin descriptions, help shortcuts and absolute skill paths. Read only the relevant skill.
32
32
  Add that instruction to its existing project instructions without replacing them.
33
33
  Use the absolute launcher, or prepend its bin directory to that session's PATH.
34
34
  Never overwrite another global `ez`; it may belong to a different installation.