Skip to content

fix: add user-global tier to agent prompt resolution - #1268

Draft
shivchander wants to merge 1 commit into
mainfrom
fix/1264-agent-prompt-user-global-tier
Draft

fix: add user-global tier to agent prompt resolution#1268
shivchander wants to merge 1 commit into
mainfrom
fix/1264-agent-prompt-user-global-tier

Conversation

@shivchander

Copy link
Copy Markdown
Collaborator

Closes #1264

Changes

  • Widen AgentRole from Literal[...] to str so plugin-defined roles are accepted without hardcoding every possible value
  • Add user-global prompt tier (~/.factory/agents/prompts/<role>.md) between project-local and factory default in resolve_prompt() — plugins that install agent prompts to this directory are now discoverable
  • Update error message to mention the user-global path when no prompt is found
  • Update test that asserted AgentRole was a Literal to verify it's now str

…ole to str

Closes #1264

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Sentrux Quality Report

Absolute

Scanning ....
[scan] git ls-files: 609 total, 597 kept, 12 dropped (ext:12, meta:0, big:0)
[build_project_map] 597 files, 102 unique dirs, 94 cache misses, 5.9ms
[resolve] 1088 resolved, 1535 unresolved (of 2623 total specs)
[resolve_imports] project_map 6.0ms, suffix_idx 1.1ms, suffix_resolve 17.5ms, total 24.6ms
[build_graphs] 597 files | maps 2.4ms, imports 24.8ms, calls+inherit 6.5ms, total 33.8ms | 1087 import, 8621 call, 11 inherit edges
sentrux check — 3 rules checked

Quality: 4789

✗ [Error] max_cc: 3 function(s) exceed max cyclomatic complexity of 30
    factory/cli/_ceo_helpers.py:_validate_ceo_flags (cc=43)
    factory/cli/_ceo_helpers.py:_execute_ceo (cc=43)
    factory/cli/run.py:cmd_run (cc=32)

✗ 1 violation(s) found

Diff (vs base branch)

Scanning ....
[scan] git ls-files: 609 total, 597 kept, 12 dropped (ext:12, meta:0, big:0)
[build_project_map] 597 files, 102 unique dirs, 94 cache misses, 5.8ms
[resolve] 1088 resolved, 1535 unresolved (of 2623 total specs)
[resolve_imports] project_map 5.9ms, suffix_idx 1.1ms, suffix_resolve 17.5ms, total 24.6ms
[build_graphs] 597 files | maps 2.3ms, imports 24.7ms, calls+inherit 5.8ms, total 32.8ms | 1087 import, 8621 call, 11 inherit edges
sentrux gate — structural regression check

Quality:      4790 -> 4789
Coupling:     0.79 → 0.79
Cycles:       3 → 3
God files:    3 → 3

Distance from Main Sequence: 0.38

✗ DEGRADED
  ✗ Complex functions increased: 53 → 54

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.30%. Comparing base (4129ba2) to head (90b80b5).

Files with missing lines Patch % Lines
factory/agents/runner.py 20.00% 11 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (20.00%) is below the target coverage (79.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1268      +/-   ##
==========================================
- Coverage   86.34%   86.30%   -0.05%     
==========================================
  Files         211      211              
  Lines       23054    23067      +13     
  Branches     3627     3631       +4     
==========================================
+ Hits        19906    19907       +1     
- Misses       2308     2319      +11     
- Partials      840      841       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Agent prompt resolution doesn't check ~/.factory/agents/

1 participant