Skip to content

feat(agent): AgentSpec.lean_coding minimal-overhead profile (#1381)#1545

Closed
ohdearquant wants to merge 2 commits into
mainfrom
feat/agent-lean-coding-profile
Closed

feat(agent): AgentSpec.lean_coding minimal-overhead profile (#1381)#1545
ohdearquant wants to merge 2 commits into
mainfrom
feat/agent-lean-coding-profile

Conversation

@ohdearquant

Copy link
Copy Markdown
Owner

Closes #1381.

Adds AgentSpec.lean_coding() — a minimal system-prompt, task-scoped-toolset coding profile (lion_system=False, task_class selector, _LEAN_TOOL_CLASSES).

  • lionagi/agent/spec.py
  • Tests in tests/agent/test_spec.py (green on current main)

Rebased clean onto main. Harvested from a stale fanout branch during disk/branch cleanup.

🤖 Generated with Claude Code

- Add AgentSpec.lean_coding() classmethod: lion_system=False skips the
  ~3100-char LION_SYSTEM_MESSAGE preamble, cutting system-message size by ~56%
- task_class param selects tool subsets: edit (reader+editor), run (bash),
  search (reader+search), refactor (reader+editor+bash)
- Module-level _LEAN_TOOL_CLASSES and _LEAN_TASK_PROMPTS constants (N806-clean)
- secure=True wires guard_destructive + guard_paths via existing _wire_secure_guards
- 13 new unit tests covering: lion_system=False, no LION preamble in message,
  all task_class tool sets, char limit, size comparison vs coding(), invalid
  task_class error, custom prompt, guard wiring, model passthrough
- 197 agent tests pass; ruff clean

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nt (#1648)

test_system_message_no_lion_preamble compared a hardcoded string literal
against build_system_message() output, but build_system_message() never
includes the LION preamble regardless of lion_system — the preamble is
only prepended inside create_agent(). The test always passed whether or
not the factory-level guard actually worked.

Replace it with test_lean_coding_no_lion_preamble_at_runtime, which drives
a lean_coding spec through create_agent() (load_settings=False) and
asserts the rendered system message excludes LION_SYSTEM_MESSAGE. Verified
red by temporarily forcing the preamble branch in factory.py locally,
then reverting once the failure was observed.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@oceanwaves630

Copy link
Copy Markdown
Collaborator

Closing while unreviewed and stale; #1381 remains the tracking issue and the branch is preserved. Small enough to re-cut cleanly when the agent-profile lane resumes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lean coding-agent profile: minimal system prompt + task-scoped toolsets

2 participants