feat(agent): AgentSpec.lean_coding minimal-overhead profile (#1381)#1545
Closed
ohdearquant wants to merge 2 commits into
Closed
feat(agent): AgentSpec.lean_coding minimal-overhead profile (#1381)#1545ohdearquant wants to merge 2 commits into
ohdearquant wants to merge 2 commits into
Conversation
- 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>
4 tasks
…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>
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1381.
Adds
AgentSpec.lean_coding()— a minimal system-prompt, task-scoped-toolset coding profile (lion_system=False,task_classselector,_LEAN_TOOL_CLASSES).lionagi/agent/spec.pytests/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