codee-agent 0.9.1__tar.gz → 0.9.3__tar.gz
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.
- {codee_agent-0.9.1 → codee_agent-0.9.3}/PKG-INFO +1 -1
- {codee_agent-0.9.1 → codee_agent-0.9.3}/pyproject.toml +1 -1
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/admin.py +104 -7
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/admin_service.py +26 -8
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/executor.py +14 -10
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/test_trigger_cron_skills.py +30 -15
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/test_trigger_email_skills.py +2 -1
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/trigger_aws_sqs_skills.py +4 -1
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/trigger_cron_skills.py +8 -4
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/trigger_email_skills.py +4 -1
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/trigger_issue_skills.py +3 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_admin.py +63 -10
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_admin_service.py +67 -11
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_executor.py +6 -4
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_abstract/provider.py +37 -2
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_abstract/test.py +17 -1
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_abstract/transcript.py +32 -1
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_claude_code/provider.py +57 -3
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_claude_code/test.py +63 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_codex/provider.py +35 -3
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_codex/test.py +40 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_github_copilot/provider.py +165 -4
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_github_copilot/test.py +124 -5
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_opencode/provider.py +162 -2
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_opencode/test.py +125 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/LICENSE +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/README.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/.gitignore +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/admin_api.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/admin_cli.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/agent_cli.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/coding_agents.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/init_cli.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/claude_key_rotation.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/cron_describe.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/mcp_config.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/runs_db.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/runtime_control.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/test_claude_key_rotation.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/test_mcp_config.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/test_runs_db.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/lib/test_trigger_issue_skills.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/mail_server.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/setup_wizard.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/start_cli.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/tasks_providers.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/AGENTS.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/CLAUDE.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/aws-sqs-alarm-response/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/cron-research-5xx-errors/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/story-code-reviewer/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/story-developer/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/story-planner/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/story-planner/assets/readme-template.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/story-qa/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/story-security-reviewer/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/task-code-reviewer/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/task-developer/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/task-qa/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/templates/skills/task-security-reviewer/SKILL.md +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_admin_api.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_admin_cli.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_agent_cli.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_coding_agents.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_init_cli.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_memory_index.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_setup_wizard.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/test_start_cli.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee/workflow_graph.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_admin/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_admin/codee_admin.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_abstract/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_abstract/acp.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_claude_code/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_claude_code/account.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_claude_code/credentials.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_claude_code/oauth.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_claude_code/usage.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_codex/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_github_copilot/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_agent_opencode/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_database/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_database/claude_code_accounts.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_database/database.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_database/oauth_tokens.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_main_context/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_main_context/context.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_main_context/logging.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_main_context/test_context.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_main_context/test_logging.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_abstract/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_abstract/provider.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_azure_devops/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_azure_devops/oauth.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_azure_devops/provider.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_azure_devops/test.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_jira/__init__.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_jira/provider.py +0 -0
- {codee_agent-0.9.1 → codee_agent-0.9.3}/src/codee_tasks_jira/test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codee-agent
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.3
|
|
4
4
|
Summary: A virtual co-worker that picks up Jira and Azure DevOps tasks and solves them with coding agents.
|
|
5
5
|
Keywords: ai,agent,jira,azure-devops,claude-code,github-copilot,codex,opencode,automation
|
|
6
6
|
Author: Denis Kibalko
|
|
@@ -125,6 +125,8 @@ class ModelOption(BaseModel):
|
|
|
125
125
|
has none, and ``default_effort`` the one it runs at when the skill sets
|
|
126
126
|
none, empty when the agent doesn't say. ``effort_label`` names levels that
|
|
127
127
|
aren't a reasoning effort (Copilot Auto's tiers), empty otherwise.
|
|
128
|
+
``context_tiers`` are ``[value, label]`` pairs for the context windows the
|
|
129
|
+
model offers, the default first, and empty when there is no choice.
|
|
128
130
|
"""
|
|
129
131
|
|
|
130
132
|
id: str
|
|
@@ -132,6 +134,7 @@ class ModelOption(BaseModel):
|
|
|
132
134
|
efforts: list[str] = []
|
|
133
135
|
default_effort: str = ""
|
|
134
136
|
effort_label: str = ""
|
|
137
|
+
context_tiers: list[list[str]] = []
|
|
135
138
|
|
|
136
139
|
|
|
137
140
|
class ConversationMessage(BaseModel):
|
|
@@ -216,6 +219,25 @@ class PeepStep(BaseModel):
|
|
|
216
219
|
timestamp: str = ""
|
|
217
220
|
|
|
218
221
|
|
|
222
|
+
def _context_summary(context: dict[str, int] | None) -> str:
|
|
223
|
+
"""One line on how full a session's context window is, "" when unknown.
|
|
224
|
+
|
|
225
|
+
Reads "Context: 41,245 / 128,000 tokens (32%) · 1 compaction", dropping
|
|
226
|
+
the window and share when the agent didn't say how big it is.
|
|
227
|
+
"""
|
|
228
|
+
if not context:
|
|
229
|
+
return ""
|
|
230
|
+
tokens, window = context["tokens"], context["window"]
|
|
231
|
+
compactions = context["compactions"]
|
|
232
|
+
parts = []
|
|
233
|
+
if tokens and window:
|
|
234
|
+
parts.append(f"{tokens:,} / {window:,} tokens ({tokens / window:.0%})")
|
|
235
|
+
elif tokens:
|
|
236
|
+
parts.append(f"{tokens:,} tokens")
|
|
237
|
+
parts.append(f"{compactions} compaction{'' if compactions == 1 else 's'}")
|
|
238
|
+
return "Context: " + " · ".join(parts)
|
|
239
|
+
|
|
240
|
+
|
|
219
241
|
def _active_job(job: dict[str, Any]) -> ActiveJob:
|
|
220
242
|
"""One in-flight run as its dashboard row reads it.
|
|
221
243
|
|
|
@@ -385,6 +407,8 @@ class AdminState(rx.State):
|
|
|
385
407
|
skill_model: str = ""
|
|
386
408
|
# The skill's `effort:`, empty for the model's own default.
|
|
387
409
|
skill_effort: str = ""
|
|
410
|
+
# The skill's `x-codee-context-tier:`, empty for the default window.
|
|
411
|
+
skill_context_tier: str = ""
|
|
388
412
|
# The agent code the skill declares, empty for the default agent.
|
|
389
413
|
skill_agent: str = ""
|
|
390
414
|
skill_type: str = "knowledge"
|
|
@@ -420,11 +444,13 @@ class AdminState(rx.State):
|
|
|
420
444
|
kill_job_label: str = ""
|
|
421
445
|
# The session the Peep dialog shows, held for the same reason, with the
|
|
422
446
|
# last steps read from its transcript. ``peep_note`` says why there are
|
|
423
|
-
# none, or that the session has finished since.
|
|
447
|
+
# none, or that the session has finished since. ``peep_context`` is one
|
|
448
|
+
# line on how full its context window is, empty when the agent can't tell.
|
|
424
449
|
peep_job_id: int = 0
|
|
425
450
|
peep_job_label: str = ""
|
|
426
451
|
peep_steps: list[PeepStep] = []
|
|
427
452
|
peep_note: str = ""
|
|
453
|
+
peep_context: str = ""
|
|
428
454
|
paused: bool = False
|
|
429
455
|
total_runs: int = 0
|
|
430
456
|
last_24h_runs: int = 0
|
|
@@ -648,6 +674,29 @@ class AdminState(rx.State):
|
|
|
648
674
|
return bool(self.skill_effort) and (
|
|
649
675
|
model is None or self.skill_effort not in model.efforts)
|
|
650
676
|
|
|
677
|
+
@rx.var
|
|
678
|
+
def skill_context_choices(self) -> list[list[str]]:
|
|
679
|
+
"""``[value, label]`` for each context window the picked model offers.
|
|
680
|
+
|
|
681
|
+
Empty, and the picker hidden, for a model with no choice of window. A
|
|
682
|
+
tier the skill already carries is always listed, as with effort.
|
|
683
|
+
"""
|
|
684
|
+
model = _model_option(self.agent_models, self.skill_model)
|
|
685
|
+
choices = [list(tier) for tier in model.context_tiers] if model else []
|
|
686
|
+
if (self.skill_context_tier
|
|
687
|
+
and all(value != self.skill_context_tier
|
|
688
|
+
for value, _ in choices)):
|
|
689
|
+
choices.append([self.skill_context_tier, self.skill_context_tier])
|
|
690
|
+
return choices
|
|
691
|
+
|
|
692
|
+
@rx.var
|
|
693
|
+
def skill_context_value(self) -> str:
|
|
694
|
+
"""The context picker's value: the skill's tier, or the default one."""
|
|
695
|
+
model = _model_option(self.agent_models, self.skill_model)
|
|
696
|
+
if self.skill_context_tier or not (model and model.context_tiers):
|
|
697
|
+
return self.skill_context_tier
|
|
698
|
+
return model.context_tiers[0][0]
|
|
699
|
+
|
|
651
700
|
@rx.var
|
|
652
701
|
def custom_model_query(self) -> str:
|
|
653
702
|
"""The search text when it names no known model, so it can be used as-is."""
|
|
@@ -716,6 +765,7 @@ class AdminState(rx.State):
|
|
|
716
765
|
self.skill_agent = agent
|
|
717
766
|
self.skill_model = ""
|
|
718
767
|
self.skill_effort = ""
|
|
768
|
+
self.skill_context_tier = ""
|
|
719
769
|
self.model_query = ""
|
|
720
770
|
return AdminState.load_agent_models
|
|
721
771
|
|
|
@@ -725,19 +775,31 @@ class AdminState(rx.State):
|
|
|
725
775
|
def choose_model(self, model_id: str) -> None:
|
|
726
776
|
"""Pick a model from the list, or use whatever the user typed.
|
|
727
777
|
|
|
728
|
-
An effort the newly picked model is known not to
|
|
729
|
-
it would only make that model's run fail. One
|
|
730
|
-
either way for stays, and the picker keeps
|
|
778
|
+
An effort or context window the newly picked model is known not to
|
|
779
|
+
take is cleared, since it would only make that model's run fail. One
|
|
780
|
+
the catalog can't vouch either way for stays, and the picker keeps
|
|
781
|
+
showing it.
|
|
731
782
|
"""
|
|
732
783
|
self.skill_model = model_id.strip()
|
|
733
784
|
self.model_query = ""
|
|
734
785
|
model = _model_option(self.agent_models, self.skill_model)
|
|
735
|
-
if model is
|
|
786
|
+
if model is None:
|
|
787
|
+
return
|
|
788
|
+
if self.skill_effort not in model.efforts:
|
|
736
789
|
self.skill_effort = ""
|
|
790
|
+
if all(value != self.skill_context_tier
|
|
791
|
+
for value, _ in model.context_tiers):
|
|
792
|
+
self.skill_context_tier = ""
|
|
737
793
|
|
|
738
794
|
def set_skill_effort(self, value: str) -> None:
|
|
739
795
|
self.skill_effort = "" if value == EFFORT_DEFAULT else value
|
|
740
796
|
|
|
797
|
+
def set_skill_context_tier(self, value: str) -> None:
|
|
798
|
+
"""Pick a context window; the model's default one is stored as unset."""
|
|
799
|
+
model = _model_option(self.agent_models, self.skill_model)
|
|
800
|
+
default = model.context_tiers[0][0] if model and model.context_tiers else ""
|
|
801
|
+
self.skill_context_tier = "" if value == default else value
|
|
802
|
+
|
|
741
803
|
@rx.event(background=True)
|
|
742
804
|
async def load_agent_models(self) -> None:
|
|
743
805
|
"""Fetch the catalog of the agent this skill runs on, off the event loop.
|
|
@@ -814,6 +876,7 @@ class AdminState(rx.State):
|
|
|
814
876
|
self.skill_description = skill["description"]
|
|
815
877
|
self.skill_model = skill["model"]
|
|
816
878
|
self.skill_effort = skill["effort"]
|
|
879
|
+
self.skill_context_tier = skill["context_tier"]
|
|
817
880
|
self.skill_agent = skill["agent"]
|
|
818
881
|
self.model_query = ""
|
|
819
882
|
self.skill_type = skill["type"]
|
|
@@ -839,6 +902,7 @@ class AdminState(rx.State):
|
|
|
839
902
|
"description": self.skill_description,
|
|
840
903
|
"model": self.skill_model,
|
|
841
904
|
"effort": self.skill_effort,
|
|
905
|
+
"context_tier": self.skill_context_tier,
|
|
842
906
|
"agent": self.skill_agent,
|
|
843
907
|
"type": self.skill_type,
|
|
844
908
|
"cron": self.skill_cron,
|
|
@@ -1003,6 +1067,7 @@ class AdminState(rx.State):
|
|
|
1003
1067
|
self.peep_job_id = job_id
|
|
1004
1068
|
self.peep_job_label = label
|
|
1005
1069
|
self.peep_steps = []
|
|
1070
|
+
self.peep_context = ""
|
|
1006
1071
|
self._load_peep()
|
|
1007
1072
|
|
|
1008
1073
|
def set_peep_dialog_open(self, is_open: bool) -> None:
|
|
@@ -1011,6 +1076,7 @@ class AdminState(rx.State):
|
|
|
1011
1076
|
self.peep_job_label = ""
|
|
1012
1077
|
self.peep_steps = []
|
|
1013
1078
|
self.peep_note = ""
|
|
1079
|
+
self.peep_context = ""
|
|
1014
1080
|
|
|
1015
1081
|
def refresh_peep(self) -> None:
|
|
1016
1082
|
if self.peep_job_id:
|
|
@@ -1037,6 +1103,7 @@ class AdminState(rx.State):
|
|
|
1037
1103
|
"sessions yet.")
|
|
1038
1104
|
return
|
|
1039
1105
|
self.peep_steps = [PeepStep(**entry) for entry in peep["entries"]]
|
|
1106
|
+
self.peep_context = _context_summary(peep.get("context"))
|
|
1040
1107
|
self.peep_note = ("" if self.peep_steps else
|
|
1041
1108
|
"Nothing to show yet. The agent may still be "
|
|
1042
1109
|
"starting up.")
|
|
@@ -2295,6 +2362,9 @@ def peep_dialog() -> rx.Component:
|
|
|
2295
2362
|
font_size="0.85rem", overflow="hidden",
|
|
2296
2363
|
text_overflow="ellipsis", white_space="nowrap"),
|
|
2297
2364
|
color=MUTED),
|
|
2365
|
+
rx.cond(AdminState.peep_context != "",
|
|
2366
|
+
rx.text(AdminState.peep_context, color=MUTED,
|
|
2367
|
+
font_size="0.8rem", margin_top="0.35rem")),
|
|
2298
2368
|
rx.vstack(
|
|
2299
2369
|
rx.foreach(AdminState.peep_steps, peep_step),
|
|
2300
2370
|
rx.cond(AdminState.peep_note != "",
|
|
@@ -2765,6 +2835,32 @@ def effort_picker() -> rx.Component:
|
|
|
2765
2835
|
flex="1", min_width="0"))
|
|
2766
2836
|
|
|
2767
2837
|
|
|
2838
|
+
def context_picker() -> rx.Component:
|
|
2839
|
+
"""Context window for the picked model, shown only when it offers a choice."""
|
|
2840
|
+
return rx.cond(
|
|
2841
|
+
AdminState.skill_context_choices.length() > 0,
|
|
2842
|
+
rx.box(field(
|
|
2843
|
+
"Context window",
|
|
2844
|
+
rx.select.root(
|
|
2845
|
+
rx.select.trigger(width="100%"),
|
|
2846
|
+
rx.select.content(
|
|
2847
|
+
rx.foreach(AdminState.skill_context_choices,
|
|
2848
|
+
lambda choice: rx.select.item(
|
|
2849
|
+
choice[1], value=choice[0]))),
|
|
2850
|
+
value=AdminState.skill_context_value,
|
|
2851
|
+
on_change=AdminState.set_skill_context_tier),
|
|
2852
|
+
rx.text(
|
|
2853
|
+
rx.cond(
|
|
2854
|
+
AdminState.skill_context_tier == "",
|
|
2855
|
+
"Runs on the model's default window.",
|
|
2856
|
+
rx.fragment("Saved as ",
|
|
2857
|
+
rx.code("x-codee-context-tier: ",
|
|
2858
|
+
AdminState.skill_context_tier),
|
|
2859
|
+
" in the skill frontmatter.")),
|
|
2860
|
+
color=MUTED, font_size="0.82rem")),
|
|
2861
|
+
flex="1", min_width="0"))
|
|
2862
|
+
|
|
2863
|
+
|
|
2768
2864
|
def delete_skill_dialog() -> rx.Component:
|
|
2769
2865
|
return rx.alert_dialog.root(
|
|
2770
2866
|
rx.alert_dialog.trigger(
|
|
@@ -2805,10 +2901,11 @@ def skill_editor() -> rx.Component:
|
|
|
2805
2901
|
on_change=AdminState.set_skill_description,
|
|
2806
2902
|
width="100%", min_height="5rem")),
|
|
2807
2903
|
rx.grid(agent_picker(),
|
|
2808
|
-
# Effort
|
|
2809
|
-
# when the picked model has
|
|
2904
|
+
# Effort and context window share the model's column; the
|
|
2905
|
+
# model takes all of it when the picked model has neither.
|
|
2810
2906
|
rx.flex(rx.box(model_picker(), flex="1", min_width="0"),
|
|
2811
2907
|
effort_picker(),
|
|
2908
|
+
context_picker(),
|
|
2812
2909
|
direction=rx.breakpoints(initial="column", sm="row"),
|
|
2813
2910
|
gap="1rem", align="start", width="100%"),
|
|
2814
2911
|
columns=rx.breakpoints(initial="1", md="2"), gap="1rem",
|
|
@@ -88,6 +88,7 @@ MANAGED = {
|
|
|
88
88
|
"model",
|
|
89
89
|
"effort",
|
|
90
90
|
"disable-model-invocation",
|
|
91
|
+
"x-codee-context-tier",
|
|
91
92
|
"cron",
|
|
92
93
|
"x-codee-agent",
|
|
93
94
|
"x-codee-trigger",
|
|
@@ -638,6 +639,8 @@ def _skill_run_summary(
|
|
|
638
639
|
]
|
|
639
640
|
if skill.effort:
|
|
640
641
|
lines.append(f"Effort: {skill.effort}")
|
|
642
|
+
if skill.context_tier:
|
|
643
|
+
lines.append(f"Context: {skill.context_tier}")
|
|
641
644
|
lines.append(f"Skill: {skill.name}")
|
|
642
645
|
return lines
|
|
643
646
|
|
|
@@ -977,6 +980,8 @@ class AdminService:
|
|
|
977
980
|
"agent": _agent_code(frontmatter.get("x-codee-agent", "")),
|
|
978
981
|
"model": str(frontmatter.get("model", "") or "").strip(),
|
|
979
982
|
"effort": str(frontmatter.get("effort", "") or "").strip(),
|
|
983
|
+
"context_tier": str(frontmatter.get(
|
|
984
|
+
"x-codee-context-tier", "") or "").strip(),
|
|
980
985
|
"issue_status": _format_issue_status(
|
|
981
986
|
frontmatter.get("x-codee-issue-status", [])
|
|
982
987
|
),
|
|
@@ -1030,7 +1035,8 @@ class AdminService:
|
|
|
1030
1035
|
return [{"id": model.id, "name": model.name,
|
|
1031
1036
|
"efforts": list(model.efforts),
|
|
1032
1037
|
"default_effort": model.default_effort,
|
|
1033
|
-
"effort_label": model.effort_label
|
|
1038
|
+
"effort_label": model.effort_label,
|
|
1039
|
+
"context_tiers": [list(tier) for tier in model.context_tiers]}
|
|
1034
1040
|
for model in models]
|
|
1035
1041
|
|
|
1036
1042
|
def resolve_skill_slug(self, label: str) -> str:
|
|
@@ -1782,6 +1788,7 @@ class AdminService:
|
|
|
1782
1788
|
"description": str(frontmatter.get("description", "")),
|
|
1783
1789
|
"model": str(frontmatter.get("model", "") or ""),
|
|
1784
1790
|
"effort": str(frontmatter.get("effort", "") or ""),
|
|
1791
|
+
"context_tier": str(frontmatter.get("x-codee-context-tier", "") or ""),
|
|
1785
1792
|
"agent": _agent_code(frontmatter.get("x-codee-agent", "")),
|
|
1786
1793
|
"type": infer_skill_type(frontmatter),
|
|
1787
1794
|
"cron": str(frontmatter.get("x-codee-cron", frontmatter.get("cron", "0 0 * * *"))),
|
|
@@ -1825,9 +1832,10 @@ class AdminService:
|
|
|
1825
1832
|
"name": name,
|
|
1826
1833
|
"description": skill["description"],
|
|
1827
1834
|
}
|
|
1828
|
-
#
|
|
1829
|
-
#
|
|
1830
|
-
#
|
|
1835
|
+
# These are left out entirely when unset, so the skill keeps running on
|
|
1836
|
+
# the default agent, whatever model that agent defaults to, that
|
|
1837
|
+
# model's own effort and its default context window, rather than on an
|
|
1838
|
+
# empty value.
|
|
1831
1839
|
agent = skill.get("agent", "").strip()
|
|
1832
1840
|
if agent:
|
|
1833
1841
|
if resolve_agent_code(agent) is None:
|
|
@@ -1839,6 +1847,9 @@ class AdminService:
|
|
|
1839
1847
|
effort = skill.get("effort", "").strip()
|
|
1840
1848
|
if effort:
|
|
1841
1849
|
frontmatter["effort"] = effort
|
|
1850
|
+
context_tier = skill.get("context_tier", "").strip()
|
|
1851
|
+
if context_tier and context_tier != "default":
|
|
1852
|
+
frontmatter["x-codee-context-tier"] = context_tier
|
|
1842
1853
|
skill_type = skill["type"]
|
|
1843
1854
|
if skill_type == "slash command":
|
|
1844
1855
|
frontmatter["disable-model-invocation"] = True
|
|
@@ -2083,8 +2094,10 @@ class AdminService:
|
|
|
2083
2094
|
"""The last ``limit`` steps of a running session. None once it finished.
|
|
2084
2095
|
|
|
2085
2096
|
``entries`` is None rather than a list when the session's agent keeps
|
|
2086
|
-
no transcript Codee can read.
|
|
2087
|
-
|
|
2097
|
+
no transcript Codee can read. ``context`` says how full the session's
|
|
2098
|
+
context window is, None when the agent can't tell. A row that names no
|
|
2099
|
+
agent, from before the dashboard recorded one, is read as the default
|
|
2100
|
+
agent's.
|
|
2088
2101
|
"""
|
|
2089
2102
|
job = next((job for job in runs_db.active_jobs(main_context=self.context)
|
|
2090
2103
|
if job["id"] == job_id), None)
|
|
@@ -2093,21 +2106,26 @@ class AdminService:
|
|
|
2093
2106
|
agent = (resolve_agent_code(job.get("agent") or "")
|
|
2094
2107
|
or self.context.settings.coding_agent)
|
|
2095
2108
|
implementation = CODING_AGENTS.get(agent)
|
|
2096
|
-
entries = None
|
|
2109
|
+
entries = context = None
|
|
2097
2110
|
if implementation is not None:
|
|
2098
2111
|
try:
|
|
2099
2112
|
entries = implementation.peep(job["session_id"], self.root,
|
|
2100
2113
|
limit)
|
|
2114
|
+
context = implementation.context_usage(job["session_id"],
|
|
2115
|
+
self.root)
|
|
2101
2116
|
except Exception as error:
|
|
2102
2117
|
print(f"[admin] Could not read job {job_id}'s transcript: "
|
|
2103
2118
|
f"{error}")
|
|
2104
|
-
entries = []
|
|
2119
|
+
entries = entries or []
|
|
2105
2120
|
return {
|
|
2106
2121
|
"agent": agent_label(agent),
|
|
2107
2122
|
"entries": (None if entries is None else
|
|
2108
2123
|
[{"kind": entry.kind, "text": entry.text,
|
|
2109
2124
|
"timestamp": entry.timestamp}
|
|
2110
2125
|
for entry in entries]),
|
|
2126
|
+
"context": (None if context is None else
|
|
2127
|
+
{"tokens": context.tokens, "window": context.window,
|
|
2128
|
+
"compactions": context.compactions}),
|
|
2111
2129
|
}
|
|
2112
2130
|
|
|
2113
2131
|
def set_paused(self, paused: bool) -> bool:
|
|
@@ -292,12 +292,14 @@ def _pull_latest_code() -> bool:
|
|
|
292
292
|
|
|
293
293
|
|
|
294
294
|
def _run_agent(user_message: str, session_id: str, model: str = "",
|
|
295
|
-
agent_code: str = "", label: str = "", effort: str = ""
|
|
295
|
+
agent_code: str = "", label: str = "", effort: str = "",
|
|
296
|
+
context_tier: str = "") -> str:
|
|
296
297
|
"""Run the skill's coding agent and return its response text.
|
|
297
298
|
|
|
298
299
|
``model`` comes from the triggering skill's ``model:`` frontmatter; agents
|
|
299
300
|
that can't be told which model to use ignore it. ``effort`` comes from its
|
|
300
|
-
``effort:`` frontmatter the same way
|
|
301
|
+
``effort:`` frontmatter the same way, and ``context_tier`` from its
|
|
302
|
+
``x-codee-context-tier:``. ``agent_code`` comes from
|
|
301
303
|
its ``x-codee-agent:`` frontmatter and picks which agent runs at all, empty
|
|
302
304
|
for the default one. Wraps the agent run in job tracking; the agent itself
|
|
303
305
|
raises on any failure so callers can retry.
|
|
@@ -311,8 +313,8 @@ def _run_agent(user_message: str, session_id: str, model: str = "",
|
|
|
311
313
|
agent=agent.DISPLAY_NAME,
|
|
312
314
|
model=model, main_context=context)
|
|
313
315
|
log.debug("job %s started: session=%s message=%r model=%r effort=%r "
|
|
314
|
-
"agent=%s", job_id, session_id, user_message,
|
|
315
|
-
agent.describe())
|
|
316
|
+
"context_tier=%r agent=%s", job_id, session_id, user_message,
|
|
317
|
+
model, effort, context_tier, agent.describe())
|
|
316
318
|
|
|
317
319
|
def opened(agent_session_id: str) -> None:
|
|
318
320
|
"""Record the session the agent actually opened, if it isn't ours.
|
|
@@ -330,7 +332,8 @@ def _run_agent(user_message: str, session_id: str, model: str = "",
|
|
|
330
332
|
|
|
331
333
|
_job_scope.job_id = job_id
|
|
332
334
|
try:
|
|
333
|
-
return agent.run(user_message, session_id, model, opened, effort
|
|
335
|
+
return agent.run(user_message, session_id, model, opened, effort,
|
|
336
|
+
context_tier)
|
|
334
337
|
except Exception:
|
|
335
338
|
# The agent exits however SIGTERM makes it exit, usually as a failure.
|
|
336
339
|
# Asked for from the dashboard, that is a kill and not worth a retry.
|
|
@@ -352,7 +355,7 @@ def _run_agent(user_message: str, session_id: str, model: str = "",
|
|
|
352
355
|
|
|
353
356
|
def _run_task(task_id: str, message: str, session_id: str, skill_name: str,
|
|
354
357
|
model: str = "", agent_code: str = "", label: str = "",
|
|
355
|
-
effort: str = "") -> None:
|
|
358
|
+
effort: str = "", context_tier: str = "") -> None:
|
|
356
359
|
"""Pool worker: run one task's coding agent, then release its in-flight slot.
|
|
357
360
|
|
|
358
361
|
Logs the outcome to the runs table like the cron/email/sqs triggers do, so
|
|
@@ -368,7 +371,7 @@ def _run_task(task_id: str, message: str, session_id: str, skill_name: str,
|
|
|
368
371
|
shown = label or message
|
|
369
372
|
try:
|
|
370
373
|
response = _run_agent(message, session_id, model, agent_code, label,
|
|
371
|
-
effort)
|
|
374
|
+
effort, context_tier)
|
|
372
375
|
log.info("Agent response for %s (%d chars): %s",
|
|
373
376
|
task_id, len(response), response)
|
|
374
377
|
runs_db.record_run(skill_name, "issue", session_id, "succeeded",
|
|
@@ -399,7 +402,7 @@ def _run_task(task_id: str, message: str, session_id: str, skill_name: str,
|
|
|
399
402
|
|
|
400
403
|
def _submit_task(task_id: str, message: str, session_id: str, skill_name: str,
|
|
401
404
|
model: str = "", agent_code: str = "", label: str = "",
|
|
402
|
-
effort: str = "") -> bool:
|
|
405
|
+
effort: str = "", context_tier: str = "") -> bool:
|
|
403
406
|
"""Start a task's agent unless one is already in flight or we're at the cap.
|
|
404
407
|
|
|
405
408
|
Returns True if launched, False if skipped — as a duplicate, or because
|
|
@@ -426,7 +429,7 @@ def _submit_task(task_id: str, message: str, session_id: str, skill_name: str,
|
|
|
426
429
|
# killing it mid-run, which is what the thread pool used to give us.
|
|
427
430
|
threading.Thread(target=_run_task, name=f"task-agent-{task_id}",
|
|
428
431
|
args=(task_id, message, session_id, skill_name, model,
|
|
429
|
-
agent_code, label, effort)).start()
|
|
432
|
+
agent_code, label, effort, context_tier)).start()
|
|
430
433
|
log.info("Started an agent for %s (%d running, max %d).",
|
|
431
434
|
task_id, depth, limit)
|
|
432
435
|
return True
|
|
@@ -528,7 +531,8 @@ def run_once() -> None:
|
|
|
528
531
|
task_id, status, issue_type, summary, session_id)
|
|
529
532
|
|
|
530
533
|
_submit_task(task_id, message, session_id, skill.name,
|
|
531
|
-
skill.model, skill.agent, label, skill.effort
|
|
534
|
+
skill.model, skill.agent, label, skill.effort,
|
|
535
|
+
skill.context_tier)
|
|
532
536
|
|
|
533
537
|
|
|
534
538
|
def main() -> None:
|
|
@@ -172,7 +172,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
172
172
|
calls = []
|
|
173
173
|
|
|
174
174
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
175
|
-
agent: str = "", effort: str = ""
|
|
175
|
+
agent: str = "", effort: str = "",
|
|
176
|
+
context_tier: str = "") -> str:
|
|
176
177
|
calls.append((model, agent))
|
|
177
178
|
return "done"
|
|
178
179
|
|
|
@@ -204,7 +205,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
204
205
|
calls = []
|
|
205
206
|
|
|
206
207
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
207
|
-
agent: str = "", effort: str = ""
|
|
208
|
+
agent: str = "", effort: str = "",
|
|
209
|
+
context_tier: str = "") -> str:
|
|
208
210
|
calls.append((message, session_id))
|
|
209
211
|
return "done"
|
|
210
212
|
|
|
@@ -239,7 +241,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
239
241
|
calls = []
|
|
240
242
|
|
|
241
243
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
242
|
-
agent: str = "", effort: str = ""
|
|
244
|
+
agent: str = "", effort: str = "",
|
|
245
|
+
context_tier: str = "") -> str:
|
|
243
246
|
calls.append(session_id)
|
|
244
247
|
if len(calls) == 1:
|
|
245
248
|
raise RuntimeError("over limit")
|
|
@@ -275,7 +278,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
275
278
|
calls = []
|
|
276
279
|
|
|
277
280
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
278
|
-
agent: str = "", effort: str = ""
|
|
281
|
+
agent: str = "", effort: str = "",
|
|
282
|
+
context_tier: str = "") -> str:
|
|
279
283
|
calls.append(session_id)
|
|
280
284
|
raise runs_db.JobKilled()
|
|
281
285
|
|
|
@@ -321,7 +325,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
321
325
|
calls = []
|
|
322
326
|
|
|
323
327
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
324
|
-
agent: str = "", effort: str = ""
|
|
328
|
+
agent: str = "", effort: str = "",
|
|
329
|
+
context_tier: str = "") -> str:
|
|
325
330
|
calls.append((message, session_id))
|
|
326
331
|
return "done"
|
|
327
332
|
|
|
@@ -379,7 +384,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
379
384
|
calls = []
|
|
380
385
|
|
|
381
386
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
382
|
-
agent: str = "", effort: str = ""
|
|
387
|
+
agent: str = "", effort: str = "",
|
|
388
|
+
context_tier: str = "") -> str:
|
|
383
389
|
calls.append((message, session_id))
|
|
384
390
|
return "done"
|
|
385
391
|
|
|
@@ -415,7 +421,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
415
421
|
calls = []
|
|
416
422
|
|
|
417
423
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
418
|
-
agent: str = "", effort: str = ""
|
|
424
|
+
agent: str = "", effort: str = "",
|
|
425
|
+
context_tier: str = "") -> str:
|
|
419
426
|
calls.append(session_id)
|
|
420
427
|
return "done"
|
|
421
428
|
|
|
@@ -456,7 +463,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
456
463
|
calls = []
|
|
457
464
|
|
|
458
465
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
459
|
-
agent: str = "", effort: str = ""
|
|
466
|
+
agent: str = "", effort: str = "",
|
|
467
|
+
context_tier: str = "") -> str:
|
|
460
468
|
calls.append(session_id)
|
|
461
469
|
raise RuntimeError("over limit")
|
|
462
470
|
|
|
@@ -488,15 +496,18 @@ class CronSkillTests(unittest.TestCase):
|
|
|
488
496
|
calls = []
|
|
489
497
|
|
|
490
498
|
def run_claude(message: str, session_id: str, model: str = "",
|
|
491
|
-
agent: str = "", effort: str = ""
|
|
492
|
-
|
|
499
|
+
agent: str = "", effort: str = "",
|
|
500
|
+
context_tier: str = "") -> str:
|
|
501
|
+
calls.append((model, effort, context_tier))
|
|
493
502
|
return "done"
|
|
494
503
|
|
|
495
504
|
with tempfile.TemporaryDirectory() as temp_dir:
|
|
496
505
|
root = Path(temp_dir)
|
|
497
506
|
skills_dir = root / "skills"
|
|
498
507
|
for slug, model_line in (("with-model", "model: claude-opus-5\n"
|
|
499
|
-
"effort: high\n"
|
|
508
|
+
"effort: high\n"
|
|
509
|
+
"x-codee-context-tier: "
|
|
510
|
+
"long_context\n"),
|
|
500
511
|
("without-model", "")):
|
|
501
512
|
skill_dir = skills_dir / slug
|
|
502
513
|
skill_dir.mkdir(parents=True)
|
|
@@ -516,7 +527,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
516
527
|
main_context=_ctx(root))
|
|
517
528
|
|
|
518
529
|
# Sorted by directory name, so the skill declaring a model comes first.
|
|
519
|
-
self.assertEqual(calls, [("claude-opus-5", "high"
|
|
530
|
+
self.assertEqual(calls, [("claude-opus-5", "high", "long_context"),
|
|
531
|
+
("", "", "")])
|
|
520
532
|
|
|
521
533
|
def test_reconcile_runs_one_aws_sqs_message_per_tick(self):
|
|
522
534
|
calls = []
|
|
@@ -528,7 +540,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
528
540
|
sqs_source = FakeSqsMessageSource([message])
|
|
529
541
|
|
|
530
542
|
def run_claude(user_message: str, session_id: str, model: str = "",
|
|
531
|
-
agent: str = "", effort: str = ""
|
|
543
|
+
agent: str = "", effort: str = "",
|
|
544
|
+
context_tier: str = "") -> str:
|
|
532
545
|
calls.append((user_message, session_id))
|
|
533
546
|
return "done"
|
|
534
547
|
|
|
@@ -568,7 +581,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
568
581
|
sqs_source = FakeSqsMessageSource([message])
|
|
569
582
|
|
|
570
583
|
def run_claude(user_message: str, session_id: str, model: str = "",
|
|
571
|
-
agent: str = "", effort: str = ""
|
|
584
|
+
agent: str = "", effort: str = "",
|
|
585
|
+
context_tier: str = "") -> str:
|
|
572
586
|
raise runs_db.JobKilled()
|
|
573
587
|
|
|
574
588
|
with tempfile.TemporaryDirectory() as temp_dir:
|
|
@@ -599,7 +613,8 @@ class CronSkillTests(unittest.TestCase):
|
|
|
599
613
|
|
|
600
614
|
def test_reconcile_survives_unconfigured_aws_client(self):
|
|
601
615
|
def run_claude(user_message: str, session_id: str, model: str = "",
|
|
602
|
-
agent: str = "", effort: str = ""
|
|
616
|
+
agent: str = "", effort: str = "",
|
|
617
|
+
context_tier: str = "") -> str:
|
|
603
618
|
raise AssertionError("should not run without an SQS client")
|
|
604
619
|
|
|
605
620
|
with tempfile.TemporaryDirectory() as temp_dir:
|
|
@@ -70,7 +70,8 @@ class EmailTriggerTests(unittest.TestCase):
|
|
|
70
70
|
patch.object(module.runs_db, "record_run").start()
|
|
71
71
|
self.addCleanup(patch.stopall)
|
|
72
72
|
|
|
73
|
-
def run_claude(self, prompt, session_id, model, agent, effort=""
|
|
73
|
+
def run_claude(self, prompt, session_id, model, agent, effort="",
|
|
74
|
+
context_tier=""):
|
|
74
75
|
self.prompts.append(prompt)
|
|
75
76
|
return "ok"
|
|
76
77
|
|
|
@@ -24,6 +24,7 @@ class AwsSqsTriggeredSkill:
|
|
|
24
24
|
model: str
|
|
25
25
|
agent: str = ""
|
|
26
26
|
effort: str = ""
|
|
27
|
+
context_tier: str = ""
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
@dataclass(frozen=True)
|
|
@@ -76,7 +77,8 @@ def trigger_aws_sqs_skills(
|
|
|
76
77
|
prompt = render_aws_sqs_prompt(skill.body, message.content)
|
|
77
78
|
try:
|
|
78
79
|
response = run_claude(prompt, session_id, skill.model, skill.agent,
|
|
79
|
-
effort=skill.effort
|
|
80
|
+
effort=skill.effort,
|
|
81
|
+
context_tier=skill.context_tier)
|
|
80
82
|
print(
|
|
81
83
|
f"[aws_sqs_skills] Claude response for {skill.name} ({len(response)} chars)")
|
|
82
84
|
sqs_message_source.delete(message)
|
|
@@ -144,6 +146,7 @@ def find_aws_sqs_triggered_skills(skills_dir: Path = SKILLS_DIR) -> list[AwsSqsT
|
|
|
144
146
|
model=metadata.get("model", "").strip(),
|
|
145
147
|
agent=metadata.get("x-codee-agent", "").strip(),
|
|
146
148
|
effort=metadata.get("effort", "").strip(),
|
|
149
|
+
context_tier=metadata.get("x-codee-context-tier", "").strip(),
|
|
147
150
|
)
|
|
148
151
|
)
|
|
149
152
|
return skills
|
|
@@ -21,9 +21,10 @@ SKILLS_DIR = default_skills_dir(REPO_ROOT)
|
|
|
21
21
|
DEFAULT_CATCHUP = timedelta(hours=24)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
# (prompt, session_id, model, agent, *, effort) -> agent reply.
|
|
25
|
-
# skill's `model:` frontmatter, `agent` its `x-codee-agent
|
|
26
|
-
# `effort
|
|
24
|
+
# (prompt, session_id, model, agent, *, effort, context_tier) -> agent reply.
|
|
25
|
+
# `model` is the skill's `model:` frontmatter, `agent` its `x-codee-agent:`,
|
|
26
|
+
# `effort` its `effort:` and `context_tier` its `x-codee-context-tier:`, each
|
|
27
|
+
# empty when the skill declares none.
|
|
27
28
|
RunClaude = Callable[..., str]
|
|
28
29
|
|
|
29
30
|
|
|
@@ -43,6 +44,7 @@ class ScheduledSkill:
|
|
|
43
44
|
model: str
|
|
44
45
|
agent: str = ""
|
|
45
46
|
effort: str = ""
|
|
47
|
+
context_tier: str = ""
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
def _get_force_file_path(main_context: CodeeMainContext) -> Path:
|
|
@@ -122,7 +124,8 @@ def trigger_cron_skills(
|
|
|
122
124
|
session_id = str(uuid.uuid4())
|
|
123
125
|
try:
|
|
124
126
|
response = run_claude(skill.body, session_id, skill.model,
|
|
125
|
-
skill.agent, effort=skill.effort
|
|
127
|
+
skill.agent, effort=skill.effort,
|
|
128
|
+
context_tier=skill.context_tier)
|
|
126
129
|
print(
|
|
127
130
|
f"[cron_skills] Claude response for {skill.name} ({len(response)} chars)")
|
|
128
131
|
runs_db.record_run(skill.name, "cron", session_id,
|
|
@@ -212,6 +215,7 @@ def _find_scheduled_skills(skills_dir: Path = SKILLS_DIR) -> list[ScheduledSkill
|
|
|
212
215
|
model=metadata.get("model", "").strip(),
|
|
213
216
|
agent=metadata.get("x-codee-agent", "").strip(),
|
|
214
217
|
effort=metadata.get("effort", "").strip(),
|
|
218
|
+
context_tier=metadata.get("x-codee-context-tier", "").strip(),
|
|
215
219
|
)
|
|
216
220
|
)
|
|
217
221
|
return skills
|