pi-subagent-manager 0.2.0 → 0.3.1
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.
- package/README.md +93 -18
- package/agents/architect.md +38 -2
- package/agents/coder.md +42 -0
- package/agents/reviewer.md +34 -0
- package/agents/tasker.md +40 -0
- package/agents/writer.md +34 -0
- package/docs/default-agents.md +112 -0
- package/docs/research-claude.md +258 -0
- package/docs/research-codex.md +143 -0
- package/docs/research-default-agent-models.md +119 -0
- package/docs/research-model-roles-coding.md +99 -0
- package/docs/research-model-roles-writing.md +78 -0
- package/package.json +8 -3
- package/src/agent-import.ts +245 -0
- package/src/config.ts +23 -9
- package/src/dialog.ts +631 -0
- package/src/import-discovery.ts +643 -0
- package/src/import-instructions.ts +156 -0
- package/src/import-picker.ts +231 -0
- package/src/index.ts +102 -24
- package/src/manager.ts +67 -2
- package/src/model-picker.ts +194 -92
- package/src/models.ts +8 -2
- package/src/runtime.ts +70 -15
- package/src/settings-ui.ts +173 -0
- package/src/settings.ts +153 -8
- package/src/status-ui.ts +288 -0
- package/src/thread-tree.ts +134 -0
- package/src/tools.ts +21 -10
- package/src/types.ts +24 -1
- package/src/ui.ts +760 -102
- package/agents/researcher.md +0 -14
- package/agents/worker.md +0 -6
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Technical Research: Coding-agent model roles
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Research cutoff: **2026-10-03**. Recommend advisory defaults of **Opus 5.5 for architect**, **GPT-6.1 Sol for independent reviewer**, **Sonnet 5.5 for coder**, and **GPT-6 Luna for tasker**. The dedicated [writing research](research-model-roles-writing.md) supersedes this coding-focused report's economical documentation candidate: the final writer shortlist is Opus 5.5, access-conditional Gemini 4 Argon, and GPT-6 Astra. These are role-fit starting points, not a claim of a universal SOTA winner or runtime model pins; validate with repository-specific trials before changing execution configuration.
|
|
6
|
+
|
|
7
|
+
## Access and evidence provenance
|
|
8
|
+
|
|
9
|
+
Read the requested web-research skill. The parent reports `mcp__exa__web_search_exa` and `mcp__exa__web_fetch_exa` available through codemode. Neither codemode nor these MCP functions is exposed in this sub-agent's callable tool set. Discovery nevertheless **used `functions.web_search(provider="exa")`**, with responses explicitly reporting Exa; full-page reading used `functions.fetch_content`, not Exa MCP fetch. Do not describe this as direct use of the named MCP tools or as Exa search being unavailable. Context7/code-search tools are also not exposed; this is model selection, not library API research.
|
|
10
|
+
|
|
11
|
+
Sources below were consulted for this cutoff. Live pages may change and are not archived historical snapshots. Release dates are reported source dates, not independently established deployment times. OpenAI's Sol launch page returned HTTP 403 on direct fetch; its model reference was readable. Some fetches used page-local answer extraction; treat extracted benchmark tables as vendor evidence rather than independent reproduction.
|
|
12
|
+
|
|
13
|
+
## Recommendation matrix: advisory modelSuggestions
|
|
14
|
+
|
|
15
|
+
| Role | Suggested default | Alternatives / escalation | Rationale and limits |
|
|
16
|
+
| ---------------------------------- | ------------------------------ | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
17
|
+
| architect (also evidence research) | Claude Opus 5.5 | GPT-6 Astra for expensive, high-stakes second opinions; GPT-6.1 Sol for cheaper planning | Anthropic positions Opus for complex, open-ended sustained judgment. Benchmark execution success is not an architecture-quality evaluation. Research needs browsing and citation verification regardless of model. |
|
|
18
|
+
| reviewer | **GPT-6.1 Sol** | **GPT-6 Astra** for security-sensitive or unusually difficult reviews | GPT-only by explicit user preference; a different family from the default Claude coder provides a second perspective, not proven statistical independence. No verified review-precision win for these candidates. |
|
|
19
|
+
| coder | Claude Sonnet 5.5 | GPT-6.1 Sol; pilot Muse Spark 1.3 and DeepSeek-V4.1-Flash; Opus for complex failures | Strong recent Terminal-Bench 4.0 vendor result, lower token prices than Opus, and faster positioning. DeepSWE alone does not establish Sonnet as the best implementer. |
|
|
20
|
+
| tasker | GPT-6 Luna | DeepSeek-V4.1-Flash; Sonnet for failed/ambiguous tasks | Low published token cost suits bounded extraction, formatting, test invocation, and mechanical changes. Constrain scope and require machine-checkable acceptance. |
|
|
21
|
+
| writer | See dedicated writing research | Final shortlist: Opus 5.5; Gemini 4 Argon only if accessible; GPT-6 Astra | Creative/editorial writing is a different workload from economical documentation. This coding report does not establish writing quality. See [final bundled suggestions](default-agents.md). |
|
|
22
|
+
|
|
23
|
+
These suggestions should remain descriptive/advisory metadata. Do not silently change provider IDs, harnesses, reasoning effort, or runtime routing. A GPT coder should still receive a separate reviewer session with independent context and explicit review criteria.
|
|
24
|
+
|
|
25
|
+
## Verified names versus user aliases
|
|
26
|
+
|
|
27
|
+
| User wording | Verified public identity / documented ID | Availability evidence |
|
|
28
|
+
| -------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `sonnet-5.5` | Claude Sonnet 5.5 / `claude-sonnet-5-5` | Official docs list active, released Sep 28, 2026; availability across major Claude platforms. [Docs](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) |
|
|
30
|
+
| `opus-5.5` | Claude Opus 5.5 / `claude-opus-5-5` | Official docs list active, released Sep 22, 2026. [Docs](https://platform.claude.com/docs/en/models/opus-5-5/overview) |
|
|
31
|
+
| `gpt-6.1-sol` | GPT-6.1 Sol / `gpt-6.1-sol` | Official model reference readable; Sep 29 launch identified by announcement/search sources. [Reference](https://developers.openai.com/api/docs/models/gpt-6.1-sol), [Announcement](https://openai.com/index/introducing-gpt-6-1-sol) |
|
|
32
|
+
| `gpt-6-astra` | GPT-6 Astra / `gpt-6-astra` | Public official model reference. [Reference](https://developers.openai.com/api/docs/models/gpt-6-astra) |
|
|
33
|
+
| `gpt luna` | Likely GPT-6 Luna / `gpt-6-luna` | Generation omitted by user; confirm intended generation, rather than treating the phrase as an exact ID. [Reference](https://developers.openai.com/api/docs/models/gpt-6-luna) |
|
|
34
|
+
| `must-spark-1.3` | **Unverified name**; likely Muse Spark 1.3 / `muse-spark-1.3` | Official Meta docs and launch identify Muse, not Must. Confirm typo with user. Standard and Contributor variants differ in data-use terms. [Models](https://dev.meta.ai/docs/models), [Launch](https://research.meta.ai/blog/introducing-muse-spark-1-3) |
|
|
35
|
+
| `deepseek 4.1 flash` | DeepSeek-V4.1-Flash / **`deepseek-flash`** | Sep 10, 2026 official release. Legacy `deepseek-v4-flash` aliases route to it; a guessed `deepseek-v4.1-flash` is not the documented direct-service ID. [Release](https://api-docs.deepseek.com/news/news260910) |
|
|
36
|
+
|
|
37
|
+
Public documentation does not guarantee access in a particular account, provider, region, or coding harness.
|
|
38
|
+
|
|
39
|
+
## Findings
|
|
40
|
+
|
|
41
|
+
1. **DeepSWE is especially relevant to implementation, but harness differences dominate narrow score gaps.** Datacurve's DeepSWE v1.1 describes long-horizon tasks across 113 tasks, 91 repositories and five languages, graded with functional and regression tests. The official board is the preferred reference. Secondary reporting updated Oct 2 separates provider runs from standardized mini-swe-agent entries: GPT-6.1 Sol 75.2%, Opus 5.5 74.2%, Sonnet 5.5 71.0%; it also reports Muse 75.4% and Astra 74.1%. These secondary numbers are **not independently verified primary-source scores here** and must not be presented as a common-harness ranking. Confidence intervals and task costs for new provider rows are incomplete. [Official board](https://deepswe.datacurve.ai/), [dated secondary report](https://codingfleet.com/blog/deepswe-v11-leaderboard-2026/)
|
|
42
|
+
|
|
43
|
+
2. **DeepSeek provides particularly concrete harness-sensitivity evidence.** Its September model card reports DeepSWE v1.1 **74.2** using mini-SWE at maximum reasoning effort, versus **66.2 in Pi**, **65.6 in Codex**, and **69.8 in Claude Code** in its scaffold comparison. These are vendor evaluations, not a reproduction in this repository. The comparison uses eight samples/task for DeepSWE, three for Terminal-Bench 2.1, up to 500 steps, and max reasoning. Strong benchmark results at max effort do not establish cheap bounded-task latency at low effort. [Model card](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash)
|
|
44
|
+
|
|
45
|
+
3. **Terminal-Bench versions cannot be merged.** Anthropic's Sep 28 Sonnet launch reports **70.6% on Terminal-Bench 4.0**, with Opus 5.5 **66.4%** subject to the launch table's footnote/settings. DeepSeek's model card reports **90.6 on 2.1**, **30.0 on 3.0**, and **31.2 on 4.0**, with its own Minimal harness. This does not justify comparing 90.6 directly to 70.6 or declaring an unconditional winner. Use the official leaderboard and match task version, harness, effort, tool/network access, retries and scoring. [Sonnet launch](https://www.anthropic.com/claude-sonnet-5-5), [DeepSeek card](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash), [Terminal-Bench](https://www.tbench.ai/leaderboard)
|
|
46
|
+
|
|
47
|
+
4. **SWE-bench evidence remains a gap for this exact shortlist.** No adequately verified, version-matched SWE-bench Verified/Pro result set for all requested candidates was obtained. Do not substitute DeepSWE for SWE-bench or invent missing scores. Nor should issue-resolution pass rate be treated as review precision.
|
|
48
|
+
|
|
49
|
+
5. **GPT reviewer recommendation is preference-constrained, not a proven precision ranking.** Sol's official model reference recommends comparing near-Astra capability against cost on one's own tasks. No current, matched review benchmark for Sol/Astra versus Sonnet/Opus was established. Review evaluation needs true actionable defect precision, false-positive comments/PR, recall, severity calibration and human acceptance—not just bug-fixing success. Require file/line, reproducible failure, impact and minimal suggested fix; permit an empty findings list, prohibit unsolicited rewrites, and cap comments. [Sol reference](https://developers.openai.com/api/docs/models/gpt-6.1-sol)
|
|
50
|
+
|
|
51
|
+
6. **Conciseness is not a GPT-family invariant.** Meta reports Muse 1.3 uses about 20% fewer tool calls and 25% fewer tokens than Muse 1.2 in its engineers' comparisons; that is a vendor, within-family comparison, not GPT review evidence. OpenAI's Sol system-card text reports longer final answers than GPT-6 Sol/Luna but slightly shorter than Astra on HealthBench—non-coding evidence that cannot establish review concision. There is no support here for “GPT always writes less code.” Control reviewer length through task policy and evaluate it locally. [Meta launch](https://research.meta.ai/blog/introducing-muse-spark-1-3), [OpenAI system-card addendum](https://deploymentsafety.openai.com/gpt-6-1-sol/kernelgen-1p)
|
|
52
|
+
|
|
53
|
+
7. **Latency depends on effort and total trajectory.** Anthropic describes Sonnet as fast, Opus as moderate, and claims Sonnet 5.5 output generation is 30%+ faster than Sonnet 5, not all competitors. Artificial Analysis's live comparison gives Sonnet-medium versus Opus-low about 92 versus 72 output tokens/s and 1.42 versus 12.76 seconds to first token, yet per-task time about 131 versus 87 seconds: token speed does not equal task speed. These are live, configuration-specific measurements, not archived Oct 3 guarantees. Sol's reference supports low through max, but **not none/minimal**. Measure p50/p95 wall time and accepted-result cost on the actual harness. [Launch](https://www.anthropic.com/claude-sonnet-5-5), [AA comparison](https://artificialanalysis.ai/models/comparisons/claude-sonnet-5-5-medium-vs-claude-opus-5-5-low), [Sol reference](https://developers.openai.com/api/docs/models/gpt-6.1-sol)
|
|
54
|
+
|
|
55
|
+
## Cost snapshot
|
|
56
|
+
|
|
57
|
+
USD per million uncached input / output tokens; exclude tool fees, retry costs and cache discounts. OpenAI figures below are **Standard-processing short-context rates**, not unrestricted tariffs. Official long-context rates are Sol **$4 / $15**, Astra **$20 / $75**, and Luna **$0.20 / $0.75**. Luna's reference applies its higher rates to the full request when input exceeds **272K tokens**; consult each model's live reference for its applicable threshold before cost-sensitive routing. Live pricing is not a frozen historical tariff. [Official OpenAI pricing](https://developers.openai.com/api/docs/pricing).
|
|
58
|
+
|
|
59
|
+
| Model | Input / output | Evidence / qualification |
|
|
60
|
+
| ----------------------- | -----------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| Sonnet 5.5 | $2 / $10 | Official Sep 28 launch and docs |
|
|
62
|
+
| Opus 5.5 | $4 / $20 | Official model docs |
|
|
63
|
+
| GPT-6.1 Sol | $2 / $10 | Readable official model reference and independently fetched official pricing; Standard short-context |
|
|
64
|
+
| GPT-6 Astra | $10 / $50 | Independently fetched official pricing; Standard short-context; verify live billing |
|
|
65
|
+
| GPT-6 Luna | $0.10 / $0.50 | Official model reference and pricing; Standard short-context, higher rates above 272K input tokens |
|
|
66
|
+
| Muse Spark 1.3 Standard | $1.25 / $4.25 | Official Meta product page; Contributor $0.10 / $0.20 allows product improvement/training, so is not an equivalent privacy tier |
|
|
67
|
+
| DeepSeek-V4.1-Flash | $0.15 / $0.60 off-peak; $0.30 / $1.20 peak | Official pricing fetched; cache-hit input $0.003 / $0.006 respectively; UTC schedule applies |
|
|
68
|
+
|
|
69
|
+
[Meta product/pricing](https://developer.meta.com/ai/models/muse-spark/), [DeepSeek pricing](https://api-docs.deepseek.com/quick_start/pricing), [Official OpenAI pricing](https://developers.openai.com/api/docs/pricing). Low token tariffs do not guarantee lowest cost per successful task.
|
|
70
|
+
|
|
71
|
+
## Key APIs and usage constraints
|
|
72
|
+
|
|
73
|
+
No runtime configuration changes are proposed. Names above are verified direct-provider identities for disambiguation, not pins. Sol tool calling requires the Responses API; Chat Completions supports it without tool calling. Luna supports tools/function calling through Responses; Chat Completions function calling requires `reasoning_effort=none`, so check harness compatibility before using a reasoning-enabled tasker. [Luna reference](https://developers.openai.com/api/docs/models/gpt-6-luna). Meta Standard tier supports Muse 1.3 max reasoning; Contributor changes both data-use terms and available reasoning effort: max is Standard-only. Equivalent performance at shared efforts was not established. [Meta reasoning docs](https://ai.developer.meta.com/docs/reasoning/). DeepSeek's direct-service Flash alias is mutable, so record actual model version during evaluations.
|
|
74
|
+
|
|
75
|
+
Illustrative reviewer policy, not a model-specific API call:
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
Review independently; do not edit files.
|
|
79
|
+
Report only actionable defects introduced by the diff.
|
|
80
|
+
For each: severity, file:line, failure scenario, evidence, minimal fix.
|
|
81
|
+
No style-only findings or unsolicited rewrites. Maximum five findings.
|
|
82
|
+
Return “No actionable findings” when appropriate. Mark unverified claims.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Sources
|
|
86
|
+
|
|
87
|
+
Kept: official Claude model pages/launch (identity, dates, costs and vendor evaluations); official OpenAI model references (identity and API constraints); Meta models/product/launch (identity, availability, data tiers and efficiency claims); DeepSeek release/pricing/model card (alias, costs and harness-specific results); Datacurve and Terminal-Bench boards (canonical benchmark context); Artificial Analysis (independent but live configuration-specific latency); CodingFleet Oct 2 report (explicitly secondary, distinguishes provider and standardized runs).
|
|
88
|
+
|
|
89
|
+
Dropped from decisive rankings: LLMBoard/Vector Wire leaderboard mirrors (mixed provenance and apparently precise ranks obscure harness differences); generic price/coding guides (not primary evaluations); older code-review comparisons involving Sonnet 4.6/GPT-5.4 mini (different models cannot settle the requested shortlist). Pricing catalog retained only as corroboration, not authority for identity or access.
|
|
90
|
+
|
|
91
|
+
## Gaps and next steps
|
|
92
|
+
|
|
93
|
+
- Named Exa MCP fetch was not callable in the original research child. The parent subsequently fetched Sonnet's launch, Sol's reference, Google's Argon announcement, Arena creative writing, and Meta's model page through Exa MCP. Independent review also fetched official pricing and Luna/Meta reasoning references, leading to the corrections above. These are source checks, not benchmark reproductions.
|
|
94
|
+
- Need archived Oct 3 sources and primary Sol/Opus/Muse DeepSWE tables before promoting secondary scores to verified values.
|
|
95
|
+
- No matched SWE-bench suite or direct review precision/conciseness evidence for the exact candidates; no direct architecture or writer evaluation.
|
|
96
|
+
- Run a small blinded repository trial with identical harness/tool permissions: accepted patches plus regressions for coder; actionable precision/false positives for reviewer; requirement coverage and tradeoff accuracy for architect; exact acceptance checks for tasker; factuality and editing burden for writer. Track effort, retries, tokens, cache use and p50/p95 cost/latency.
|
|
97
|
+
- Confirm `must` → `muse` and intended Luna generation. Check account availability separately.
|
|
98
|
+
|
|
99
|
+
Only this new research Markdown file was written; no source code or runtime model configuration was edited. The target did not exist before writing; other files were not modified.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Technical Research: advisory model roles for writing and evidence research
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Requested cutoff: **2026-10-03**; freshest dated Arena snapshot discovered: **2026-10-02**. The confirmed five defaults are **architect (absorbs research), reviewer (GPT-only), coder, tasker, writer**. Recommend keeping writing separate from evidence gathering. All names below are advisory `modelSuggestions`, not runtime pins or configuration edits.
|
|
6
|
+
|
|
7
|
+
**Tool disclosure:** the parent confirms Exa MCP search/fetch tools are accessible through its codemode. This child session does **not** expose codemode or those MCP tools and does not inherit parent tools. This research used `web_search` with `provider: "exa"` for Exa-based discovery and `fetch_content` for selected pages, not Exa MCP fetch. Context7 and code-search tools are unavailable here. Read the requested web-research skill. Only this document was written; no source/config edits or git operations were performed.
|
|
8
|
+
|
|
9
|
+
## Advisory modelSuggestions: confirmed five roles
|
|
10
|
+
|
|
11
|
+
| Role | Suggestions for evaluation | Evidence / limitation |
|
|
12
|
+
| ----------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| Architect, including research | Claude Opus 5.5; GPT-6 Astra; accessible Gemini reasoning-class model | Long-horizon planning and source synthesis; choose using identical retrieval budgets and claim-support tests, not writing preference. |
|
|
14
|
+
| Reviewer — GPT-only | GPT-6 Astra; another verified available GPT reasoning-class model if cost requires | Astra is officially documented for research and complex reasoning. Require independent source-entailment checking; do not recommend non-GPT alternatives for this role. |
|
|
15
|
+
| Coder | Claude Opus 5.5; Muse Spark 1.3 | Official releases emphasize agentic coding. This is a candidate shortlist, not a comprehensive coding benchmark ranking. |
|
|
16
|
+
| Tasker | Muse Spark 1.3; verified available Gemini Flash-class model | Cost-sensitive bounded execution candidate. Evidence here does not establish a tasker winner; test instruction following, tool-call correctness, and latency. |
|
|
17
|
+
| Writer | Claude Opus 5.5; Claude Fable 5 / 5.1; GPT-6 Astra; Gemini 4 Argon when accessible | Opus 5.5 combines strong human preference and verified general availability. Fable/Astra merit fiction and voice trials; Argon is phased/restricted. No universal writing winner. |
|
|
18
|
+
|
|
19
|
+
Do not turn the table into a mandatory provider/model lookup. Resolve actual available models against the runtime registry when implementation is requested. Fable's benchmark names do not establish an accessible provider route; Argon's Arena configuration is not an API ID.
|
|
20
|
+
|
|
21
|
+
This table records exploratory candidates from the writing/research sweep, not the finalized bundled lists. Coding/tasker choices defer to the coding report; Fable is omitted from the shipped writer suggestions because no provider route was verified. See the [final five-role suggestions](default-agents.md).
|
|
22
|
+
|
|
23
|
+
### Research-tool contract for architect
|
|
24
|
+
|
|
25
|
+
The current child runtime does not inherit MCP/parent tools. Architect must consume a **supplied research packet** or use **authorized shell retrieval**, including an Exa CLI/API only if it is actually installed/configured and authorized. Do not hardcode unavailable Exa MCP tool names into child instructions, promise nonexistent tool access, or embed credentials. If retrieval is unavailable, explicitly state that limitation and ask for parent-supplied sources. Parent-side codemode Exa access can produce the packet: URLs, dates, fetched passages, contradictions, and unresolved questions. Model ability and retrieval availability are separate decisions.
|
|
26
|
+
|
|
27
|
+
### Five versus six responsibilities
|
|
28
|
+
|
|
29
|
+
**Prefer architect + researcher:** architectural decisions naturally depend on requirements, documentation, constraints, and alternatives. Keep the writer separate so evidence collection is not optimized for compelling narrative. Risk: confirmation bias toward a preferred design; mitigate with competing hypotheses and GPT-only review.
|
|
30
|
+
|
|
31
|
+
**Writer + researcher alternative:** reduces handoffs and is useful for short, low-stakes editorial work. It couples prose preference with source selection and unsupported interpolation. If used, require research first, a frozen evidence packet, composition second, and separate citation verification. These are workflow recommendations, not leaderboard findings.
|
|
32
|
+
|
|
33
|
+
## Findings
|
|
34
|
+
|
|
35
|
+
1. **Arena measures human preference, not factuality.** The Oct 2 creative-writing index lists `gemini-4-argon-high` 1519±19 (preliminary; 1,097 votes), `claude-opus-5.5-high` 1516±20 (1,058), `claude-fable-5-high` 1503±8 (8,182), and `claude-opus-4-6-high` 1501±6 (14,085). Intervals overlap substantially. Writing/literature/language similarly lists Argon 1522±17 and Opus 5.5 1519±17. These category-specific blind preferences are not citation or editorial fact-check scores. `high` denotes a tested configuration, not necessarily an API name. [Creative writing](https://arena.ai/leaderboard/text/creative-writing), [Writing/literature/language](https://arena.ai/leaderboard/text/industry-writing-and-literature-and-language), [Overall text](https://arena.ai/leaderboard/text). **Original-child provenance:** readable fetches exposed little table content; numbers initially came from Exa's source-linked index rather than an independently captured table. **Parent verification addendum, 2026-10-03:** Exa MCP full-page fetch subsequently recovered the primary creative-writing table and confirmed Argon **1519±19** (1,097 votes), Opus **1516±20** (1,058), Fable **1503±8**, and Muse Spark 1.3 max **1459±12**. This resolves creative-table recovery, not the overall or writing/literature/language table gap; these are live source checks, not benchmark reproductions. Small vote counts and overlapping intervals still preclude a clear Argon-over-Opus win.
|
|
36
|
+
|
|
37
|
+
2. **EQ-Bench supplies a different writing signal.** Its official JS data (`v=1.0.91`), fetched for this research, reports GPT-6 Astra Elo 2173.3, Claude Fable 5.1 2162.0, Claude Opus 5 2132.6, GPT-6 Sol 2124.7, and Claude Opus 5.5 2050.1. Muse Spark 1.3 is 1905.9; Gemini 3.8 Flash 1747.9. These are LLM-judged short-form outputs, not human preference or source fidelity. Some entries have a `*` prefix whose meaning was not verified; treat those provisionally. The asset has no verified evaluation date, so it is a live snapshot rather than an archived Oct 3 guarantee. Elo is relative to the comparison pool and is not comparable to Arena's scale or a percentage. [Leaderboard](https://eqbench.com/creative_writing.html), [Actual data](https://eqbench.com/creative_writing.js?v=1.0.91). Short-form success does not establish long-form editorial revision quality.
|
|
38
|
+
|
|
39
|
+
3. **Gemini is a strong large-context candidate; availability and retrieval remain constraints.** Google's Sep 30 announcement verifies **Gemini 4 Argon**, including creative writing and long-horizon knowledge work, but describes phased rollout to trusted defenders/testers before broader access. Its Oct 2 recap describes a 1M-token window. Do not invent an API identifier from the Arena name or assume immediate access. [Announcement](https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-4-argon/), [Oct 2 recap](https://blog.google/innovation-and-ai/technology/ai/google-ai-updates-september-2026/). Google's documentation explicitly warns that multi-needle retrieval may be substantially worse than single-needle retrieval: window capacity is not retrieval accuracy or source fidelity. [Long-context docs](https://ai.google.dev/gemini-api/docs/long-context).
|
|
40
|
+
|
|
41
|
+
4. **Muse Spark 1.3 is verified; strongest evidence here concerns engineering.** Meta's Sep 2 release emphasizes long-horizon agentic/coding work. The official page lists 1M context and separate standard/contributor tiers; Vercel independently confirms integration the same day. The parent-fetched primary Arena creative-writing table places its max configuration at **1459±12**, below the leading candidates; EQ-Bench is competitive but not leading. No current citation-fidelity result was verified. [Meta release](https://research.meta.ai/blog/introducing-muse-spark-1-3), [Official model page](https://developer.meta.com/ai/models/muse-spark/), [Vercel](https://vercel.com/changelog/muse-spark-1-3-now-available-on-ai-gateway), [Arena mirror](https://www.benchleader.com/benchmarks/lmarena_text_creative). Contributor changes data-use terms and available reasoning effort: **max is Standard-only**. Equivalent performance at shared efforts was not established. Do not silently use Contributor for confidential work. [Official reasoning docs](https://ai.developer.meta.com/docs/reasoning/). We interpreted the user's `must-spark-1.3` as Muse Spark 1.3; this is an interpretation, not a verified alias. Standard `muse-spark-1.3` and Contributor `muse-spark-1.3-contributor` are distinct tier identifiers. [Official model identities](https://ai.developer.meta.com/docs/models/).
|
|
42
|
+
|
|
43
|
+
5. **BrowseComp evaluates difficult web answers, not faithful report writing.** It is not a long-context retention or citation-entailment benchmark. Secondary Sep/Oct 2026 tables disagree: BenchLM reports GPT-5.6 Sol 92.2 while AnotherWrapper reports 90.4 and names Astra its leader. Coverage/configuration differences prevent declaring a current global winner. [Official benchmark](https://openai.com/index/browsecomp/), [BenchLM, updated Sep 24](https://benchlm.ai/benchmarks/browsecomp), [AnotherWrapper, Oct 2](https://anotherwrapper.com/tools/llm-pricing/leaderboards/browsecomp). Official readable fetch returned 403; raw fetch returned text. Astra's name and availability are separately established by [API docs](https://developers.openai.com/api/docs/models/gpt-6-astra) and [announcement](https://openai.com/index/gpt-6-astra/), not proof of benchmark superiority on this project's scaffold.
|
|
44
|
+
|
|
45
|
+
6. **DeepResearchBench separates report quality from citation support.** Historical primary results give Gemini-2.5-Pro Deep Research RACE overall 48.88 versus OpenAI Deep Research 46.98, but citation accuracy 81.44% versus 77.96%; Perplexity Deep Research has 90.24% citation accuracy despite lower report-quality score (42.25). Gemini's 111.21 effective citations is a count, not a percentage. These are historical agent-system results, not an Oct 2026 raw-model ranking. [Primary results/methodology](https://deepresearch-bench.github.io/). The indexed project repository's May 2026 migration notice changes evaluators from Gemini 2.5 Pro to GPT-5.5; evaluator eras are not directly comparable. The migrated current official leaderboard was not verified. [Repository notice](https://github.com/Ayanami0730/deep_research_bench?tab=readme-ov-file).
|
|
46
|
+
|
|
47
|
+
7. **Two research benchmarks have similar names.** FutureSearch's **Deep Research Bench** uses 89 tasks and frozen RetroSearch to control web drift, studying hallucination/tool-use/forgetting and separately evaluating commercial products versus model-driven agents. It differs from RACE/FACT **DeepResearch Bench** above. [FutureSearch paper, June 2025](https://arxiv.org/html/2506.06287v1). Neither directly tests this project's exact Exa retrieval workflow or guarantees faithful million-token synthesis.
|
|
48
|
+
|
|
49
|
+
8. **Gemini Deep Research is a service/agent, not a drop-in model suggestion.** Current docs name preview agents `deep-research-preview-04-2026` and `deep-research-max-preview-04-2026`, accessed through Interactions API with background execution rather than `generate_content`. Built-in Search/URL Context/Code Execution plus optional MCP/file search constitute a different scaffold from a local Exa-equipped model. [Current docs](https://ai.google.dev/gemini-api/docs/deep-research). The earlier announcement's Gemini 3 Pro core and 59.2 BrowseComp / 66.1 DeepSearchQA claims belong to that release, not automatically newer previews or Argon. [Release article](https://blog.google/innovation-and-ai/technology/developers-tools/deep-research-agent-gemini-api/).
|
|
50
|
+
|
|
51
|
+
9. **Verify names without pinning runtime choices.** Anthropic's Sep 22 release/product page establish **Claude Opus 5.5**, general availability, and API name `claude-opus-5-5`. OpenAI docs establish **GPT-6 Astra** and `gpt-6-astra`. Meta establishes **Muse Spark 1.3**, with Vercel documenting provider-qualified routing. These are naming evidence, not configuration instructions. [Anthropic release](https://www.anthropic.com/claude-opus-5-5), [Anthropic product](https://www.anthropic.com/claude/opus), [OpenAI API docs](https://developers.openai.com/api/docs/models/gpt-6-astra), [Meta docs](https://developer.meta.com/ai/models/muse-spark/). Fable names are present in benchmark data; local provider availability was not verified.
|
|
52
|
+
|
|
53
|
+
## Source fidelity and Exa: acceptance criteria
|
|
54
|
+
|
|
55
|
+
Exa supplies discovery/retrieval; the model chooses searches, reconciles sources, and writes claims. An agent-product score cannot be transferred automatically to an Exa-equipped raw model. Links alone do not prove claim support.
|
|
56
|
+
|
|
57
|
+
Evaluate suggestions with identical available retrieval tools, budgets, prompts, and sources:
|
|
58
|
+
|
|
59
|
+
- Writing: blind voice preference, stock-phrase avoidance, style-guide adherence, revision fidelity, long-form consistency.
|
|
60
|
+
- Research: factual correctness, supported-citation precision, material-claim coverage, primary-source proportion, correct dates/versions, contradictions/abstention, long-document retrieval recall.
|
|
61
|
+
- Preserve URL, publication date where available, retrieval timestamp, and quotation/span for each material claim. Check citations against fetched text, not snippets, and recheck after composition.
|
|
62
|
+
- For child agents without retrieval, use identical supplied evidence packets and evaluate synthesis separately from discovery.
|
|
63
|
+
- Test representative tasks and inspect failures, latency, and cost before changing defaults. No source found establishes a universal writing-plus-citation winner.
|
|
64
|
+
|
|
65
|
+
## Sources: kept and dropped
|
|
66
|
+
|
|
67
|
+
**Kept:** primary Arena categories (human preference, indexed-table caveat); EQ-Bench page and actual JS (writing scores); official Google/Anthropic/OpenAI/Meta releases/docs (names and capabilities); Vercel (Muse corroboration); DeepResearch Bench primary page and FutureSearch paper (methodology distinctions). Secondary mirrors were retained for corroboration/disagreement, not definitive rank claims.
|
|
68
|
+
|
|
69
|
+
**Dropped as ranking authority:** BasedAGI EQ-Bench table (placeholder `2000-01-01` dates/inconsistent score interpretation); AnotherWrapper DeepResearchBench winner claim (unverified evaluator/scaffold comparability); Sophon's summary (superseded by primary EQ-Bench data). `www.deepresearchbench.com` failed DNS and was not treated as official.
|
|
70
|
+
|
|
71
|
+
## Gaps
|
|
72
|
+
|
|
73
|
+
- No frozen Oct 3 archive; live pages may change. These are retrieved snapshots, not guaranteed historical reconstruction.
|
|
74
|
+
- Parent Exa MCP fetch subsequently recovered the primary creative-writing table (see the dated addendum above). Overall and writing/literature/language tables were not independently recovered.
|
|
75
|
+
- No current official migrated RACE/FACT ranking, exact-model citation-fidelity comparison, or equal-scaffold Exa comparison was verified.
|
|
76
|
+
- Argon general API availability, Fable provider routes, EQ-Bench asterisk semantics, and local model/tool registry remain unverified.
|
|
77
|
+
- Tasker and comprehensive coding rankings were outside the deep-writing/research evidence scope.
|
|
78
|
+
- Next: parent can supply its now-fetched Exa MCP passages through codemode; child architect uses supplied research or actually available authorized shell retrieval. Run blind writing and claim-entailment trials before promoting advisory suggestions.
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-subagent-manager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Hierarchical, steerable subagent threads for pi",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22.19.0"
|
|
8
|
+
},
|
|
6
9
|
"keywords": [
|
|
7
10
|
"pi-package",
|
|
8
11
|
"pi",
|
|
@@ -24,6 +27,7 @@
|
|
|
24
27
|
"files": [
|
|
25
28
|
"src",
|
|
26
29
|
"agents",
|
|
30
|
+
"docs",
|
|
27
31
|
"README.md"
|
|
28
32
|
],
|
|
29
33
|
"pi": {
|
|
@@ -34,8 +38,9 @@
|
|
|
34
38
|
"scripts": {
|
|
35
39
|
"check": "tsc --noEmit",
|
|
36
40
|
"test": "tsx --test tests/*.test.ts",
|
|
37
|
-
"
|
|
38
|
-
"format
|
|
41
|
+
"prepublishOnly": "npm run check && npm test",
|
|
42
|
+
"format": "prettier --write --print-width 100 src tests agents docs/default-agents.md README.md",
|
|
43
|
+
"format:check": "prettier --check --print-width 100 src tests agents docs/default-agents.md README.md"
|
|
39
44
|
},
|
|
40
45
|
"dependencies": {
|
|
41
46
|
"shell-quote": "^1.8.3",
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { constants, lstatSync, mkdirSync, openSync, closeSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import { AGENT_COLORS, type ConfigStore } from "./config.ts";
|
|
6
|
+
import { discoverImportCandidates, type ImportCandidate } from "./import-discovery.ts";
|
|
7
|
+
import { selectImportAgents } from "./import-picker.ts";
|
|
8
|
+
import { MIGRATION_INSTRUCTIONS } from "./import-instructions.ts";
|
|
9
|
+
import { dialogText } from "./dialog.ts";
|
|
10
|
+
|
|
11
|
+
export const IMPORT_REQUEST_PREFIX =
|
|
12
|
+
"Import ONLY the agents I selected in the pi-subagent-manager migration picker.";
|
|
13
|
+
|
|
14
|
+
export const IMPORT_CHILD_TOOLS = [
|
|
15
|
+
"read",
|
|
16
|
+
"bash",
|
|
17
|
+
"powershell",
|
|
18
|
+
"edit",
|
|
19
|
+
"write",
|
|
20
|
+
"grep",
|
|
21
|
+
"find",
|
|
22
|
+
"ls",
|
|
23
|
+
"agent_types",
|
|
24
|
+
"agent_spawn",
|
|
25
|
+
"agent_wait",
|
|
26
|
+
"agent_steer",
|
|
27
|
+
"agent_status",
|
|
28
|
+
"agent_update",
|
|
29
|
+
"agent_pause",
|
|
30
|
+
"agent_stop",
|
|
31
|
+
"agent_output",
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
// This records onboarding only. Limits remain in subagent-manager/settings.json.
|
|
35
|
+
const OFFER_MARKER = ".import-offered";
|
|
36
|
+
|
|
37
|
+
function statIfPresent(path: string) {
|
|
38
|
+
try {
|
|
39
|
+
const stat = lstatSync(path);
|
|
40
|
+
if (stat.isSymbolicLink()) throw new Error(`Unsafe import-state symlink: ${path}`);
|
|
41
|
+
return stat;
|
|
42
|
+
} catch (error) {
|
|
43
|
+
if ((error as NodeJS.ErrnoException).code === "ENOENT") return undefined;
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function stateDirectory(agentDir: string, create: boolean): string | undefined {
|
|
49
|
+
const directory = join(agentDir, "subagent-manager");
|
|
50
|
+
for (const path of [agentDir, directory]) {
|
|
51
|
+
let stat = statIfPresent(path);
|
|
52
|
+
if (!stat && create) {
|
|
53
|
+
// The host owns agentDir. Do not recursively create or follow unchecked parents.
|
|
54
|
+
mkdirSync(path);
|
|
55
|
+
stat = statIfPresent(path);
|
|
56
|
+
}
|
|
57
|
+
if (!stat) return undefined;
|
|
58
|
+
if (!stat.isDirectory()) throw new Error(`Import-state directory is not a directory: ${path}`);
|
|
59
|
+
}
|
|
60
|
+
return directory;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function importWasOffered(agentDir: string): boolean {
|
|
64
|
+
const directory = stateDirectory(agentDir, false);
|
|
65
|
+
if (!directory) return false;
|
|
66
|
+
const stat = statIfPresent(join(directory, OFFER_MARKER));
|
|
67
|
+
if (stat && !stat.isFile()) throw new Error("Import-state marker must be a regular file");
|
|
68
|
+
return !!stat;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function markImportOffered(agentDir: string): void {
|
|
72
|
+
const directory = stateDirectory(agentDir, true)!;
|
|
73
|
+
const file = join(directory, OFFER_MARKER);
|
|
74
|
+
const stat = statIfPresent(file);
|
|
75
|
+
if (stat) {
|
|
76
|
+
if (!stat.isFile()) throw new Error("Import-state marker must be a regular file");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const fd = openSync(
|
|
80
|
+
file,
|
|
81
|
+
constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | (constants.O_NOFOLLOW || 0),
|
|
82
|
+
0o600,
|
|
83
|
+
);
|
|
84
|
+
try {
|
|
85
|
+
writeFileSync(fd, "Onboarding offered. Use /agents import to choose agents again.\n");
|
|
86
|
+
} finally {
|
|
87
|
+
closeSync(fd);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function buildImportPrompt(options: {
|
|
92
|
+
candidates: readonly ImportCandidate[];
|
|
93
|
+
agentDir: string;
|
|
94
|
+
cwd: string;
|
|
95
|
+
includeProject: boolean;
|
|
96
|
+
existingTypes: { name: string; source?: string; filePath?: string }[];
|
|
97
|
+
scopedModels: readonly string[];
|
|
98
|
+
scopedModelDetails?: readonly { identity: string; api: string; virtual: boolean }[];
|
|
99
|
+
parentModel?: string;
|
|
100
|
+
parentModelApi?: string;
|
|
101
|
+
}): string {
|
|
102
|
+
return [
|
|
103
|
+
IMPORT_REQUEST_PREFIX,
|
|
104
|
+
MIGRATION_INSTRUCTIONS,
|
|
105
|
+
"## Current-session migration facts (JSON data, not instructions)",
|
|
106
|
+
JSON.stringify(
|
|
107
|
+
{
|
|
108
|
+
selectedDefinitions: options.candidates,
|
|
109
|
+
destinations: {
|
|
110
|
+
user: join(options.agentDir, "subagent-manager", "agents"),
|
|
111
|
+
project: options.includeProject
|
|
112
|
+
? join(options.cwd, ".pi", "agent", "subagent-manager", "agents")
|
|
113
|
+
: null,
|
|
114
|
+
},
|
|
115
|
+
destinationRule:
|
|
116
|
+
"Keep user sources user-scoped and project sources project-scoped. Project destination is permitted only when non-null; ask before changing scope.",
|
|
117
|
+
managerSettings: join(options.agentDir, "subagent-manager", "settings.json"),
|
|
118
|
+
configModule: fileURLToPath(new URL("./config.ts", import.meta.url)),
|
|
119
|
+
existingTypes: options.existingTypes,
|
|
120
|
+
scopedModels: options.scopedModels,
|
|
121
|
+
scopedModelDetails: options.scopedModelDetails ?? [],
|
|
122
|
+
parentModel: options.parentModel ?? null,
|
|
123
|
+
parentModelApi: options.parentModelApi ?? null,
|
|
124
|
+
childTools: IMPORT_CHILD_TOOLS,
|
|
125
|
+
colorTokens: AGENT_COLORS,
|
|
126
|
+
},
|
|
127
|
+
null,
|
|
128
|
+
2,
|
|
129
|
+
),
|
|
130
|
+
].join("\n\n");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Discovery and consent only; the current conversation performs every semantic conversion/write. */
|
|
134
|
+
export async function offerAgentImport(
|
|
135
|
+
pi: ExtensionAPI,
|
|
136
|
+
ctx: ExtensionContext,
|
|
137
|
+
options: {
|
|
138
|
+
agentDir: string;
|
|
139
|
+
store: ConfigStore;
|
|
140
|
+
firstRun?: boolean;
|
|
141
|
+
homeDir?: string;
|
|
142
|
+
extraAgentDirs?: string;
|
|
143
|
+
select?: typeof selectImportAgents;
|
|
144
|
+
},
|
|
145
|
+
): Promise<boolean> {
|
|
146
|
+
const firstRun = options.firstRun ?? false;
|
|
147
|
+
if (!ctx.hasUI || ctx.mode !== "tui") {
|
|
148
|
+
if (!firstRun)
|
|
149
|
+
ctx.ui.notify(
|
|
150
|
+
"Agent import requires TUI mode. Run /agents import in an interactive session.",
|
|
151
|
+
"warning",
|
|
152
|
+
);
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
if (firstRun && importWasOffered(options.agentDir)) return false;
|
|
157
|
+
const found = discoverImportCandidates({
|
|
158
|
+
cwd: ctx.cwd,
|
|
159
|
+
agentDir: options.agentDir,
|
|
160
|
+
includeProject: ctx.isProjectTrusted(),
|
|
161
|
+
homeDir: options.homeDir,
|
|
162
|
+
extraAgentDirs: options.extraAgentDirs,
|
|
163
|
+
});
|
|
164
|
+
if (found.diagnostics.length)
|
|
165
|
+
ctx.ui.notify(dialogText(found.diagnostics.join("\n")), "warning");
|
|
166
|
+
const remember = () => {
|
|
167
|
+
try {
|
|
168
|
+
markImportOffered(options.agentDir);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
ctx.ui.notify(
|
|
171
|
+
dialogText(`Could not save import onboarding state: ${String(error)}`),
|
|
172
|
+
"warning",
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
if (!found.candidates.length) {
|
|
177
|
+
// Retry an incomplete scan next startup, rather than permanently hiding unreadable definitions.
|
|
178
|
+
if (!found.diagnostics.length) remember();
|
|
179
|
+
if (!firstRun)
|
|
180
|
+
ctx.ui.notify(
|
|
181
|
+
"No external agent definitions found. Package-provided defaults are not scanned.",
|
|
182
|
+
"info",
|
|
183
|
+
);
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
if (
|
|
187
|
+
firstRun &&
|
|
188
|
+
!(await ctx.ui.confirm(
|
|
189
|
+
"Import existing agents?",
|
|
190
|
+
`Found ${found.candidates.length} external agent definitions. Choose individual agents in a checkbox picker, then the current session model will migrate only your selection. Originals stay unchanged. You can also use /agents import later.`,
|
|
191
|
+
))
|
|
192
|
+
) {
|
|
193
|
+
remember();
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
const ids = await (options.select ?? selectImportAgents)(
|
|
197
|
+
ctx,
|
|
198
|
+
found.candidates.map((candidate) => ({
|
|
199
|
+
id: candidate.id,
|
|
200
|
+
label: `${candidate.name} (${candidate.scope})`,
|
|
201
|
+
detail: `${candidate.path}\n${candidate.description}`,
|
|
202
|
+
})),
|
|
203
|
+
);
|
|
204
|
+
if (!ids?.length) {
|
|
205
|
+
remember();
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
const selected = new Set(ids);
|
|
209
|
+
const candidates = found.candidates.filter((candidate) => selected.has(candidate.id));
|
|
210
|
+
if (!candidates.length) return false;
|
|
211
|
+
options.store.reload();
|
|
212
|
+
const prompt = buildImportPrompt({
|
|
213
|
+
candidates,
|
|
214
|
+
agentDir: options.agentDir,
|
|
215
|
+
cwd: ctx.cwd,
|
|
216
|
+
includeProject: ctx.isProjectTrusted(),
|
|
217
|
+
existingTypes: options.store
|
|
218
|
+
.list()
|
|
219
|
+
.map(({ name, source, filePath }) => ({ name, source, filePath })),
|
|
220
|
+
scopedModels: (ctx.scopedModels ?? []).map(({ model }) => `${model.provider}/${model.id}`),
|
|
221
|
+
scopedModelDetails: (ctx.scopedModels ?? []).map(({ model }) => ({
|
|
222
|
+
identity: `${model.provider}/${model.id}`,
|
|
223
|
+
api: model.api,
|
|
224
|
+
virtual: model.api === "pi-virtual",
|
|
225
|
+
})),
|
|
226
|
+
parentModel: ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : undefined,
|
|
227
|
+
parentModelApi: ctx.model?.api,
|
|
228
|
+
});
|
|
229
|
+
// This starts (or queues) a turn in the active root session, not another SDK session.
|
|
230
|
+
pi.sendUserMessage(prompt, { deliverAs: "followUp" });
|
|
231
|
+
// sendUserMessage is fire-and-forget. The root before_agent_start hook acknowledges
|
|
232
|
+
// accepted requests; authentication/model failures must leave first-run retryable.
|
|
233
|
+
ctx.ui.notify(
|
|
234
|
+
`Asked the current session model to import ${candidates.length} selected agent(s).`,
|
|
235
|
+
"info",
|
|
236
|
+
);
|
|
237
|
+
return true;
|
|
238
|
+
} catch (error) {
|
|
239
|
+
ctx.ui.notify(
|
|
240
|
+
dialogText(`Agent import failed: ${String(error)}. Retry with /agents import.`),
|
|
241
|
+
"warning",
|
|
242
|
+
);
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
}
|
package/src/config.ts
CHANGED
|
@@ -74,6 +74,7 @@ const FIELDS = new Set([
|
|
|
74
74
|
"description",
|
|
75
75
|
"models",
|
|
76
76
|
"model",
|
|
77
|
+
"modelSuggestions",
|
|
77
78
|
"thinkingLevel",
|
|
78
79
|
"color",
|
|
79
80
|
"tools",
|
|
@@ -136,6 +137,22 @@ function record(value: unknown, label: string): Record<string, unknown> {
|
|
|
136
137
|
return value as Record<string, unknown>;
|
|
137
138
|
}
|
|
138
139
|
|
|
140
|
+
/** Advisory display names only. Empty means no suggestions; never a model pin. */
|
|
141
|
+
function modelSuggestionNames(value: unknown): string[] {
|
|
142
|
+
if (!Array.isArray(value))
|
|
143
|
+
throw new Error("modelSuggestions must be an array of nonempty display names");
|
|
144
|
+
const suggestions = value.map((entry, index) => {
|
|
145
|
+
if (typeof entry !== "string")
|
|
146
|
+
throw new Error(`modelSuggestions[${index}] must be a nonempty display name`);
|
|
147
|
+
const name = entry.trim();
|
|
148
|
+
if (!name) throw new Error(`modelSuggestions[${index}] must be a nonempty display name`);
|
|
149
|
+
return name;
|
|
150
|
+
});
|
|
151
|
+
if (new Set(suggestions).size !== suggestions.length)
|
|
152
|
+
throw new Error("modelSuggestions contains duplicate display names");
|
|
153
|
+
return [...suggestions];
|
|
154
|
+
}
|
|
155
|
+
|
|
139
156
|
function toolNames(value: unknown, label: string): string[] {
|
|
140
157
|
if (
|
|
141
158
|
!Array.isArray(value) ||
|
|
@@ -189,6 +206,8 @@ export function parseAgentType(content: string, filePath?: string): AgentType {
|
|
|
189
206
|
model: data.model,
|
|
190
207
|
});
|
|
191
208
|
if (models !== undefined) result.models = models;
|
|
209
|
+
if (Object.hasOwn(data, "modelSuggestions"))
|
|
210
|
+
result.modelSuggestions = modelSuggestionNames(data.modelSuggestions);
|
|
192
211
|
if (Object.hasOwn(data, "thinkingLevel")) {
|
|
193
212
|
if (
|
|
194
213
|
!THINKING_LEVELS.includes(
|
|
@@ -226,6 +245,8 @@ export function serializeAgentType(type: AgentType): string {
|
|
|
226
245
|
};
|
|
227
246
|
const models = getModelPreferences(type);
|
|
228
247
|
if (models !== undefined) data.models = models;
|
|
248
|
+
if (type.modelSuggestions !== undefined)
|
|
249
|
+
data.modelSuggestions = modelSuggestionNames(type.modelSuggestions);
|
|
229
250
|
for (const key of ["thinkingLevel", "color", "tools"] as const)
|
|
230
251
|
if (type[key] !== undefined) data[key] = type[key];
|
|
231
252
|
const content = `---\n${stringify(data)}---\n${type.systemPrompt}`;
|
|
@@ -384,16 +405,9 @@ export class ConfigStore {
|
|
|
384
405
|
);
|
|
385
406
|
}
|
|
386
407
|
|
|
408
|
+
// Manager-owned storage only. Do not scan legacy Pi agent packages.
|
|
387
409
|
private scopeDirectories(scope: AgentScope): string[] {
|
|
388
|
-
return scope
|
|
389
|
-
? [
|
|
390
|
-
resolve(this.options.agentDir, AGENTS_DIR),
|
|
391
|
-
this.preferredScopeDirectory(scope),
|
|
392
|
-
]
|
|
393
|
-
: [
|
|
394
|
-
resolve(this.options.cwd, ".pi", AGENTS_DIR),
|
|
395
|
-
this.preferredScopeDirectory(scope),
|
|
396
|
-
];
|
|
410
|
+
return [this.preferredScopeDirectory(scope)];
|
|
397
411
|
}
|
|
398
412
|
|
|
399
413
|
private destinationBasePaths(scope: AgentScope, directory: string): string[] {
|