squad-sdk: spawnAgent ignores the persistent reasoning-effort and context-tier settings that its own commit documents

Đang mở Phù hợp với người mới
#2,521 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
ai-infra-agents, backend

Hướng nghiên cứu

Đọc packages/squad-sdk/src/agents/lifecycle.ts và các bộ phân giải cài đặt duy trì trong packages/squad-sdk/src/config/models.ts. Sau đó, xem các bài kiểm tra spawn trong test/lifecycle.test.ts, nơi cấu hình createSession đã được ghi nhận. Bổ sung kiểm thử cho defaultReasoningEffort và defaultContextTier; issue được giải quyết khi cả hai giá trị đến được session và thứ tự ưu tiên được tài liệu hóa đã được xác minh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

The two commits that threaded reasoning effort and context tier through agent spawning introduced
three things together:

  • the readers and the layered resolver in packages/squad-sdk/src/config/models.ts
    (readReasoningEffort, readAgentReasoningEffortOverrides, and the tier equivalents, 333 lines);
  • the template documentation that promises the layer -- .squad-templates/squad.agent.md, "1.
    Persistent Config: .squad/config.json ? agentReasoningEffortOverrides.{agentName}, then
    defaultReasoningEffort";
  • and the inline resolution in AgentLifecycleManager.spawnAgent that skips it:
const rawEffort = reasoningEffortOverride
  || agentConfig.resolvedReasoningEffort
  || undefined;

Environment

  • github/squad (the report was written against the bradygaster/squad fork, which carries the same
    commits; dev has the identical lines at packages/squad-sdk/src/agents/lifecycle.ts:328)
  • effort: 264b87612a -- feat(sdk): thread reasoningEffort through agent spawning pipeline (#1148),
    Co-authored-by: Copilot <[email protected]>
  • tier: f682ecb7ad -- feat(sdk,cli): thread contextTier through agent spawning pipeline (#1448),
    Co-authored-by: Copilot App <[email protected]>

Steps to reproduce

test/lifecycle.test.ts already wraps createSession and keeps every config in
sessionConfigs, and it already asserts on sessionConfigs[0].model for the persistent-config cases
(agentModelOverrides, defaultModel, 'auto'). The effort and the tier are the only two settings
that file never asserts on.

Take one of those cases, add defaultReasoningEffort and defaultContextTier to the
.squad/config.json it writes, and assert the same way:

expect(sessionConfigs[0]?.reasoningEffort).toBe('high');
expect(sessionConfigs[0]?.contextTier).toBe('long_context');

The capture itself needs no change -- it is the file's own.

Actual behavior

Running one of those persistent-config cases with defaultReasoningEffort: "high" and
defaultContextTier: "long_context" added to the config file, and no effort or tier anywhere else,
the object handed to createSession is:

{ "model": "charter-model", "systemMessage": { "content": "..." } }

reasoningEffort and contextTier are both absent (undefined), while model is the one the
charter names -- so the spawn ran, the config file was read, and only these two settings never reached
the session. Adding the assertion to that case fails:

AssertionError: expected undefined to be 'high' // Object.is equality
- Expected: "high"
+ Received:  undefined

Changing one input at a time, the same capture shows which layers do arrive:

variant .squad/config.json charter spawn option reasoningEffort in the session
A defaultReasoningEffort: high none none undefined
B none **Reasoning Effort:** medium none "medium"
C defaultReasoningEffort: high none reasoningEffortOverride: low "low"
D defaultReasoningEffort: high **Reasoning Effort:** medium none "medium"

A is the documented layer 1 and the only one that produces nothing. D shows the persistent value
losing to a charter value the documentation ranks below it. The tier behaves the same way: a charter
naming **Context Tier:** long_context reaches the session, defaultContextTier does not.

Expected behavior

{ "model": "claude-sonnet-5.5", "reasoningEffort": "high", "contextTier": "long_context" }

Suggested fix

The resolver the same commits added already implements the documented order; call it instead of
resolving inline:

const rawEffort = resolveReasoningEffort({
  agentName, squadDir,
  spawnOverride: reasoningEffortOverride,
  charterPreference: agentConfig.resolvedReasoningEffort,
});

Failing that, add the two persistent lookups in front of the charter value.

Ngôn ngữ chính
TypeScript
Star
3.4k
Fork
516
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
116

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/squad

Tất cả issue của github/squad

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.