can1357
b48b825344
fix(coding-agent): process @file before session creation; drop built-in flag-name list
...
Two review fixes for the extension-flag/initial-prompt work:
1. @file ordering — `processFileArguments` runs `process.exit(1)` on a
missing/unreadable file. It had been moved after `createSession`, which
writes the terminal breadcrumb eagerly (SessionManager.create →
#newSessionSync), so `omp @missing.md "x"` left a junk session/breadcrumb
behind before exiting.
Resolve extension-registered CLI flags BEFORE creating the session: load the
session's extensions up front (new `loadSessionExtensions` helper, the single
source of createAgentSession's discovery-branch logic), build an
ExtensionFlagSink straight from the loaded extensions + runtime, re-parse
argv, then process @file args — all before any session exists. The loaded
result is handed back to createAgentSession via `preloadedExtensions` (now
checked before `disableExtensionDiscovery`, so it can't double-load) and the
same EventBus is shared, so no extra work. This keeps the P1#1 fix
(`--flag @value` is the flag's value, not a file) while failing fast with no
session side effects.
2. "Can we avoid the big list of names?" — removed the hand-maintained
`BUILTIN_FLAG_NAMES` set (and its stale "rejected at registration" doc).
`applyExtensionFlags` now always falls back to recovering a flag's value from
argv when parseArgs didn't surface it; the recovery scan mirrors parseArgs's
consumption rules (flag-looking space-form values stay their own flag) and is
a no-op for flags that were absent or already surfaced, so no list of
built-in names is needed.
Adds `ExtensionRunner.aggregateFlags` (static) so getFlags and the CLI's
pre-session sink share one implementation.
Tests: pre-session flag resolution via the exact main.ts sink pattern;
list-free recovery of an arbitrary colliding built-in (`--model`); and the
flag-looking-value rule. Verified typecheck + extension/runner/acp suites.
2026-05-31 06:23:15 +02:00
..
2026-05-31 02:09:55 +02:00
2026-05-30 21:32:03 +02:00
2026-05-31 02:00:18 +02:00
2026-05-26 21:27:39 +03:00
2026-05-31 02:09:55 +02:00
2026-05-26 15:28:10 +02:00
2026-05-12 11:15:38 +02:00
2026-05-29 19:44:36 +00:00
2026-04-30 18:08:37 +02:00
2026-05-22 13:23:06 +00:00
2026-05-13 06:00:45 +02:00
2026-05-28 10:17:56 +02:00
2026-05-25 17:34:32 +00:00
2026-03-14 10:46:26 +01:00
2026-05-31 04:19:47 +02:00
2026-05-19 04:06:04 +00:00
2026-05-29 06:42:46 +02:00
2026-05-30 18:08:51 +02:00
2026-05-31 04:15:25 +02:00
2026-05-16 00:20:00 +02:00
2026-05-30 16:22:12 +02:00
2026-05-31 01:42:47 +02:00
2026-05-31 04:41:36 +02:00
2026-05-31 01:43:00 +02:00
2026-05-25 14:05:48 +02:00
2026-05-26 03:59:13 +02:00
2026-05-30 18:08:51 +02:00
2026-05-17 15:30:09 +08:00
2026-05-19 16:41:05 +08:00
2026-05-31 03:39:38 +02:00
2026-05-17 07:37:25 +08:00
2026-05-30 18:11:25 +02:00
2026-05-20 21:40:43 +00:00
2026-05-17 04:02:09 +02:00
2026-05-19 16:41:05 +08:00
2026-05-04 15:20:26 +02:00
2026-03-14 11:25:40 +01:00
2026-05-15 14:46:54 +02:00
2026-05-30 18:08:51 +02:00
2026-05-04 15:20:26 +02:00
2026-05-27 15:01:20 +00:00
2026-05-04 15:20:26 +02:00
2026-05-25 18:48:06 +00:00
2026-05-28 10:10:34 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-05-26 22:53:30 +02:00
2026-05-30 18:08:51 +02:00
2026-05-26 15:27:05 +02:00
2026-05-30 04:47:58 +02:00
2026-05-04 15:20:26 +02:00
2026-05-30 18:08:51 +02:00
2026-05-26 20:53:35 +02:00
2026-05-26 15:27:05 +02:00
2026-05-30 18:08:51 +02:00
2026-05-30 18:08:51 +02:00
2026-05-31 04:10:52 +02:00
2026-05-14 05:35:16 +02:00
2026-05-16 00:20:00 +02:00
2026-05-15 14:46:54 +02:00
2026-05-04 15:20:26 +02:00
2026-05-27 22:16:23 -04:00
2026-04-23 21:02:14 +02:00
2026-05-17 13:15:07 +02:00
2026-05-22 13:08:51 +09:00
2026-05-16 20:44:07 +02:00
2026-03-14 11:25:40 +01:00
2026-05-26 05:32:47 +02:00
2026-05-31 03:32:21 +02:00
2026-05-14 04:36:19 +02:00
2026-05-02 07:01:57 +02:00
2026-05-02 03:31:27 +02:00
2026-05-17 04:02:09 +02:00
2026-04-10 14:51:27 -05:00
2026-05-16 20:12:26 +02:00
2026-05-25 18:48:20 +00:00
2026-05-30 16:31:48 +02:00
2026-05-12 04:09:33 +02:00
2026-03-01 09:55:02 +01:00
2026-05-14 05:35:16 +02:00
2026-03-03 06:07:22 +01:00
2026-03-03 06:07:22 +01:00
2026-04-02 07:35:44 +02:00
2026-05-15 02:25:07 +00:00
2026-03-11 00:03:48 +01:00
2026-05-15 15:16:50 +02:00
2026-05-04 15:20:26 +02:00
2026-05-21 16:37:44 +09:00
2026-05-15 18:31:12 +02:00
2026-05-04 15:20:26 +02:00
2026-05-15 18:31:12 +02:00
2026-05-14 04:36:19 +02:00
2026-05-14 04:36:19 +02:00
2026-03-03 14:45:06 +01:00
2026-04-08 18:52:42 +02:00
2026-05-06 17:13:11 +02:00
2026-05-15 14:46:54 +02:00
2026-05-30 15:59:58 +02:00
2026-05-26 01:54:09 -07:00
2026-05-14 04:36:19 +02:00
2026-05-31 03:48:19 +02:00
2026-05-17 02:32:12 +02:00
2026-05-13 08:18:07 +00:00
2026-05-06 19:01:21 +02:00
2026-05-31 06:23:15 +02:00
2026-05-17 03:47:45 +02:00
2026-05-21 17:35:04 +09:00
2026-05-30 18:08:51 +02:00
2026-05-14 04:36:19 +02:00
2026-04-11 08:54:27 +02:00
2026-02-16 10:08:53 +01:00
2026-05-14 04:36:19 +02:00
2026-05-03 09:48:11 +02:00
2026-05-03 09:48:11 +02:00
2026-05-03 09:48:11 +02:00
2026-05-17 04:02:09 +02:00
2026-04-23 21:02:14 +02:00
2026-05-25 20:48:46 +02:00
2026-03-03 15:09:46 +01:00
2026-03-03 15:12:50 +01:00
2026-05-12 04:09:33 +02:00
2026-05-13 13:21:59 +02:00
2026-04-08 14:42:51 +02:00
2026-03-22 18:28:40 +01:00
2026-05-31 04:25:14 +02:00
2026-05-04 00:19:06 +02:00
2026-05-14 05:35:16 +02:00
2026-05-29 06:16:32 +00:00
2026-05-14 04:36:19 +02:00
2026-05-22 13:41:17 +00:00
2026-05-14 04:36:19 +02:00
2026-05-31 04:25:14 +02:00
2026-05-23 19:59:55 +00:00
2026-05-04 15:20:26 +02:00
2026-05-14 04:36:19 +02:00
2026-05-04 00:19:06 +02:00
2026-05-14 04:36:19 +02:00
2026-04-30 04:51:23 +02:00
2026-04-30 04:51:23 +02:00
2026-04-30 04:51:23 +02:00
2026-05-02 07:55:30 +02:00
2026-05-02 07:48:30 +02:00
2026-05-14 04:36:19 +02:00
2026-05-30 06:12:18 +08:00
2026-05-09 03:11:19 +02:00
2026-05-09 03:11:18 +02:00
2026-05-09 04:02:20 +02:00
2026-05-10 03:21:02 +08:00
2026-05-10 05:09:29 +02:00
2026-05-10 04:55:43 +02:00
2026-05-12 06:56:39 +02:00
2026-05-28 12:50:52 +02:00
2026-05-13 01:56:18 +02:00
2026-05-30 17:40:18 +02:00
2026-05-25 12:22:57 +02:00
2026-05-26 11:34:30 +00:00
2026-05-27 05:46:35 +00:00
2026-04-02 07:35:44 +02:00
2026-03-22 18:28:40 +01:00
2026-04-26 06:59:47 +02:00
2026-05-31 04:34:45 +02:00
2026-05-31 01:04:56 +02:00
2026-05-12 04:09:33 +02:00
2026-05-07 15:40:45 +02:00
2026-05-14 06:40:41 +02:00
2026-05-31 04:25:14 +02:00
2026-03-03 04:00:30 +01:00
2026-03-20 23:48:38 +01:00
2026-05-12 04:09:33 +02:00
2026-03-03 06:07:22 +01:00
2026-05-26 20:30:02 +02:00
2026-04-30 15:04:33 +02:00
2026-05-29 06:42:47 +02:00
2026-03-14 11:00:07 +01:00
2026-05-14 04:36:19 +02:00
2026-05-30 16:55:53 +02:00
2026-04-13 00:58:32 +02:00
2026-05-12 04:09:33 +02:00
2026-05-30 15:58:26 +02:00
2026-04-13 15:46:06 +02:00
2026-05-30 04:34:55 +02:00
2026-05-26 20:22:25 +02:00
2026-05-13 15:39:04 -07:00
2026-02-23 06:21:32 +00:00
2026-05-15 00:03:57 +02:00
2026-05-04 15:20:26 +02:00
2026-05-12 04:09:33 +02:00
2026-05-11 00:05:00 +00:00
2026-05-07 15:06:39 -03:00
2026-05-14 06:40:50 +02:00
2026-05-27 00:04:45 +02:00
2026-05-13 06:00:45 +02:00
2026-05-29 18:12:08 +02:00
2026-05-26 13:25:22 +02:00
2026-05-27 03:55:04 +02:00
2026-05-16 18:52:04 +02:00
2026-05-13 05:24:33 +02:00
2026-05-14 04:36:19 +02:00
2026-03-26 19:12:51 +01:00
2026-05-30 16:55:54 +02:00
2026-02-20 12:28:25 +01:00
2026-01-28 21:12:28 +01:00
2026-05-30 18:08:51 +02:00
2026-05-30 18:08:51 +02:00
2026-03-06 12:35:01 +01:00
2026-05-26 05:32:47 +02:00
2026-05-17 04:02:09 +02:00
2026-04-08 08:47:32 +02:00
2026-05-26 20:53:35 +02:00
2026-05-04 18:06:12 +02:00
2026-04-23 21:02:14 +02:00
2026-05-27 15:15:53 +02:00
2026-05-12 04:09:33 +02:00
2026-05-15 17:00:18 +02:00
2026-05-30 18:08:51 +02:00
2026-03-02 17:01:44 +01:00
2026-03-26 16:17:27 +01:00
2026-05-21 16:46:46 +09:00
2026-05-31 00:46:03 +02:00
2026-05-14 05:12:07 +02:00
2026-05-13 23:58:13 +00:00
2026-03-13 15:14:05 +01:00
2026-05-22 13:03:03 +09:00
2026-05-30 00:54:40 +02:00
2026-05-25 14:06:05 +02:00
2026-05-12 04:09:33 +02:00
2026-05-25 12:37:32 +02:00
2026-05-25 12:37:32 +02:00
2026-03-03 14:32:02 +01:00
2026-04-18 23:24:00 +02:00
2026-05-15 14:46:54 +02:00
2026-05-15 14:46:54 +02:00
2026-05-30 18:08:51 +02:00
2026-05-28 13:03:45 +02:00
2026-05-04 15:20:26 +02:00
2026-05-30 16:55:54 +02:00
2026-02-15 10:20:11 +01:00
2026-04-07 02:00:59 +02:00
2026-05-31 03:39:38 +02:00
2026-05-31 02:14:58 +02:00
2026-05-30 23:13:11 +02:00
2026-05-31 02:14:58 +02:00
2026-05-31 02:14:58 +02:00
2026-05-30 23:13:11 +02:00
2026-05-12 04:09:33 +02:00
2026-05-31 04:25:14 +02:00
2026-02-01 10:23:41 +01:00
2026-02-18 01:53:02 +01:00
2026-03-26 19:12:50 +01:00
2026-05-21 00:09:43 +00:00
2026-05-14 04:36:19 +02:00
2026-01-29 10:47:55 +01:00
2026-05-30 17:01:40 +02:00
2026-05-10 07:59:53 +02:00
2026-05-13 06:00:45 +02:00
2026-05-29 18:12:08 +02:00
2026-05-28 00:34:11 +02:00
2026-05-25 14:06:13 +02:00