codee-agent 0.9.3__tar.gz → 0.9.4__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.
Files changed (102) hide show
  1. {codee_agent-0.9.3 → codee_agent-0.9.4}/PKG-INFO +1 -1
  2. {codee_agent-0.9.3 → codee_agent-0.9.4}/pyproject.toml +1 -1
  3. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/admin.py +108 -9
  4. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/admin_service.py +77 -6
  5. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_admin_service.py +97 -0
  6. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_claude_code/account.py +16 -4
  7. codee_agent-0.9.4/src/codee_agent_claude_code/credentials.py +300 -0
  8. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_claude_code/test.py +103 -0
  9. codee_agent-0.9.3/src/codee_agent_claude_code/credentials.py +0 -133
  10. {codee_agent-0.9.3 → codee_agent-0.9.4}/LICENSE +0 -0
  11. {codee_agent-0.9.3 → codee_agent-0.9.4}/README.md +0 -0
  12. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/.gitignore +0 -0
  13. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/__init__.py +0 -0
  14. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/admin_api.py +0 -0
  15. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/admin_cli.py +0 -0
  16. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/agent_cli.py +0 -0
  17. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/coding_agents.py +0 -0
  18. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/executor.py +0 -0
  19. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/init_cli.py +0 -0
  20. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/__init__.py +0 -0
  21. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/claude_key_rotation.py +0 -0
  22. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/cron_describe.py +0 -0
  23. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/mcp_config.py +0 -0
  24. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/runs_db.py +0 -0
  25. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/runtime_control.py +0 -0
  26. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/test_claude_key_rotation.py +0 -0
  27. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/test_mcp_config.py +0 -0
  28. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/test_runs_db.py +0 -0
  29. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/test_trigger_cron_skills.py +0 -0
  30. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/test_trigger_email_skills.py +0 -0
  31. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/test_trigger_issue_skills.py +0 -0
  32. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/trigger_aws_sqs_skills.py +0 -0
  33. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/trigger_cron_skills.py +0 -0
  34. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/trigger_email_skills.py +0 -0
  35. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/lib/trigger_issue_skills.py +0 -0
  36. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/mail_server.py +0 -0
  37. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/setup_wizard.py +0 -0
  38. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/start_cli.py +0 -0
  39. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/tasks_providers.py +0 -0
  40. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/AGENTS.md +0 -0
  41. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/CLAUDE.md +0 -0
  42. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/aws-sqs-alarm-response/SKILL.md +0 -0
  43. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/cron-research-5xx-errors/SKILL.md +0 -0
  44. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/story-code-reviewer/SKILL.md +0 -0
  45. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/story-developer/SKILL.md +0 -0
  46. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/story-planner/SKILL.md +0 -0
  47. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/story-planner/assets/readme-template.md +0 -0
  48. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/story-qa/SKILL.md +0 -0
  49. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/story-security-reviewer/SKILL.md +0 -0
  50. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/task-code-reviewer/SKILL.md +0 -0
  51. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/task-developer/SKILL.md +0 -0
  52. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/task-qa/SKILL.md +0 -0
  53. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/templates/skills/task-security-reviewer/SKILL.md +0 -0
  54. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_admin.py +0 -0
  55. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_admin_api.py +0 -0
  56. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_admin_cli.py +0 -0
  57. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_agent_cli.py +0 -0
  58. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_coding_agents.py +0 -0
  59. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_executor.py +0 -0
  60. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_init_cli.py +0 -0
  61. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_memory_index.py +0 -0
  62. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_setup_wizard.py +0 -0
  63. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/test_start_cli.py +0 -0
  64. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee/workflow_graph.py +0 -0
  65. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_admin/__init__.py +0 -0
  66. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_admin/codee_admin.py +0 -0
  67. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_abstract/__init__.py +0 -0
  68. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_abstract/acp.py +0 -0
  69. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_abstract/provider.py +0 -0
  70. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_abstract/test.py +0 -0
  71. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_abstract/transcript.py +0 -0
  72. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_claude_code/__init__.py +0 -0
  73. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_claude_code/oauth.py +0 -0
  74. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_claude_code/provider.py +0 -0
  75. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_claude_code/usage.py +0 -0
  76. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_codex/__init__.py +0 -0
  77. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_codex/provider.py +0 -0
  78. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_codex/test.py +0 -0
  79. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_github_copilot/__init__.py +0 -0
  80. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_github_copilot/provider.py +0 -0
  81. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_github_copilot/test.py +0 -0
  82. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_opencode/__init__.py +0 -0
  83. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_opencode/provider.py +0 -0
  84. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_agent_opencode/test.py +0 -0
  85. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_database/__init__.py +0 -0
  86. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_database/claude_code_accounts.py +0 -0
  87. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_database/database.py +0 -0
  88. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_database/oauth_tokens.py +0 -0
  89. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_main_context/__init__.py +0 -0
  90. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_main_context/context.py +0 -0
  91. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_main_context/logging.py +0 -0
  92. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_main_context/test_context.py +0 -0
  93. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_main_context/test_logging.py +0 -0
  94. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_tasks_abstract/__init__.py +0 -0
  95. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_tasks_abstract/provider.py +0 -0
  96. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_tasks_azure_devops/__init__.py +0 -0
  97. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_tasks_azure_devops/oauth.py +0 -0
  98. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_tasks_azure_devops/provider.py +0 -0
  99. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_tasks_azure_devops/test.py +0 -0
  100. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_tasks_jira/__init__.py +0 -0
  101. {codee_agent-0.9.3 → codee_agent-0.9.4}/src/codee_tasks_jira/provider.py +0 -0
  102. {codee_agent-0.9.3 → codee_agent-0.9.4}/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
3
+ Version: 0.9.4
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codee-agent"
3
- version = "0.9.3"
3
+ version = "0.9.4"
4
4
  description = "A virtual co-worker that picks up Jira and Azure DevOps tasks and solves them with coding agents."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -11,7 +11,7 @@ from pydantic import BaseModel
11
11
  from codee.admin_api import api_app
12
12
  from codee.admin_service import (
13
13
  AGENTS_FILE, TASKS_CHECKS, WORKFLOW_HIGHLIGHT_GROUPS, AdminService,
14
- SKILL_TYPES, WorkflowGeneration, normalize_work_items)
14
+ SKILL_TYPES, WorkflowGeneration, context_tier_label, normalize_work_items)
15
15
  from codee.workflow_graph import workflow_graph
16
16
  from codee_main_context.context import (
17
17
  DEFAULT_ISSUE_TYPES, TasksProvider, credential_field)
@@ -50,7 +50,8 @@ def _skill_summary(skill: dict[str, str]) -> SkillSummary:
50
50
  """One listing row, with its agent named the way the editor's picker does."""
51
51
  return SkillSummary(**{
52
52
  **skill,
53
- "agent": AGENT_NAMES.get(skill["agent"], DEFAULT_AGENT_OPTION)})
53
+ "agent": AGENT_NAMES.get(skill["agent"], DEFAULT_AGENT_OPTION),
54
+ "context_tier": context_tier_label(skill["context_tier"])})
54
55
 
55
56
 
56
57
  def _model_option(models: list["ModelOption"],
@@ -114,6 +115,9 @@ class SkillSummary(BaseModel):
114
115
  agent: str = ""
115
116
  model: str = ""
116
117
  effort: str = ""
118
+ # The skill's `x-codee-context-tier:` as a person reads it, empty for the
119
+ # model's default window.
120
+ context_tier: str = ""
117
121
  issue_status: str = ""
118
122
  issue_type: str = ""
119
123
 
@@ -466,6 +470,9 @@ class AdminState(rx.State):
466
470
  # slow loop of its own.
467
471
  claude_account_usage: list[ClaudeAccount] = []
468
472
  claude_usage_loading: bool = False
473
+ # The account a "Set current" click is switching to, or 0. One at a time:
474
+ # two switches racing would leave the CLI on whichever wrote last.
475
+ claude_switching_account: int = 0
469
476
 
470
477
  runs: list[RunRecord] = []
471
478
  runs_has_more: bool = False
@@ -1171,6 +1178,36 @@ class AdminState(rx.State):
1171
1178
  for account in measured]
1172
1179
  await asyncio.sleep(USAGE_POLL_INTERVAL)
1173
1180
 
1181
+ @rx.event(background=True)
1182
+ async def use_claude_code_account(self, account_id: int) -> Any:
1183
+ """Make one account current and sign Claude Code in as it.
1184
+
1185
+ In the background because it can be two network round trips — renewing
1186
+ the token, then reading the profile — and the dashboard redraws every
1187
+ second meanwhile. The usage rows are redrawn as soon as it lands, so
1188
+ the "in use" badge moves without waiting out the slow usage loop.
1189
+ """
1190
+ async with self:
1191
+ if self.claude_switching_account:
1192
+ return
1193
+ self.claude_switching_account = account_id
1194
+
1195
+ try:
1196
+ switched, message = await asyncio.to_thread(
1197
+ SERVICE.use_claude_code_account, account_id)
1198
+ measured = await asyncio.to_thread(
1199
+ SERVICE.claude_code_account_usage)
1200
+ except Exception as error: # noqa: BLE001 - never leave the row spinning
1201
+ switched, message = False, f"{type(error).__name__}: {error}"
1202
+ measured = None
1203
+
1204
+ async with self:
1205
+ self.claude_switching_account = 0
1206
+ if measured is not None:
1207
+ self.claude_account_usage = [_usage_row(account)
1208
+ for account in measured]
1209
+ yield rx.toast.success(message) if switched else rx.toast.error(message)
1210
+
1174
1211
  def _fetch_runs_page(self, offset: int,
1175
1212
  limit: int = RUNS_PAGE_SIZE) -> list[RunRecord]:
1176
1213
  """One page of runs. Reads one row past the page to learn whether more exist."""
@@ -2032,13 +2069,34 @@ SUBTLE_ICON = "var(--codee-subtle-icon)"
2032
2069
  RUNNING_BACKGROUND = "var(--codee-running-background)"
2033
2070
  RUNNING_GLOW = "var(--codee-running-glow)"
2034
2071
  MONO = "IBM Plex Mono, monospace"
2035
- LOGO = "👨🏻‍💻"
2036
- # Inline SVG carrying the logo emoji, so the favicon needs no binary asset.
2072
+ # Corner brackets with an open palm and a spark; fills use currentColor so the
2073
+ # mark takes the colour of the badge it sits in.
2074
+ LOGO = (
2075
+ '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" style="display:block" aria-hidden="true" fill="none" viewBox="6 6 36 36"><path fill="currentColor" d="M7.5 14.9V7.5H14.9V10.5H10.5V14.9Z"></path><path fill="currentColor" d="M40.5 14.9V7.5H33.1V10.5H37.5V14.9Z"></path><path fill="currentColor" d="M7.5 33.1V40.5H14.9V37.5H10.5V33.1Z"></path><path fill="currentColor" d="M40.5 33.1V40.5H33.1V37.5H37.5V33.1Z"></path><g fill="currentColor"><rect x="19.9" y="16.4" width="2.85" height="10" rx="1.425"></rect><rect x="23.3" y="14.75" width="2.85" height="11" rx="1.425"></rect><rect x="26.7" y="15.6" width="2.85" height="10.5" rx="1.425"></rect><rect x="30.1" y="17.9" width="2.85" height="9" rx="1.425"></rect><path d="M32.95 24.6V28C32.95 31 30.6 33.25 27.6 33.25H25.6C23 33.25 18.71 28.21 17.29 26.52Q16.2 25.22 15.11 23.92A1.425 1.425 0 0 1 17.29 22.08Q18.6 23.64 19.9 25.19V24.6Z"></path></g><path fill="currentColor" d="M16 15.3Q16.69 16.91 18.3 17.6Q16.69 18.29 16 19.9Q15.31 18.29 13.7 17.6Q15.31 16.91 16 15.3Z"></path></svg>'
2076
+ )
2077
+ # The logo on the accent-blue badge, inline so the favicon needs no binary asset.
2037
2078
  FAVICON = (
2038
2079
  "data:image/svg+xml;base64,"
2039
- "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMD"
2040
- "AgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7wn5Go8J+Pu+KAjfCfkrs8L3Rl"
2041
- "eHQ+PC9zdmc+"
2080
+ "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAz"
2081
+ "MiAzMiI+PHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNiIgZmlsbD0iIzJmNmZk"
2082
+ "NiIvPjxzdmcgeD0iMyIgeT0iMyIgd2lkdGg9IjI2IiBoZWlnaHQ9IjI2IiB2aWV3Qm94PSI2"
2083
+ "IDYgMzYgMzYiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik03LjUgMTQuOVY3LjVIMTQuOVYxMC41"
2084
+ "SDEwLjVWMTQuOVoiPjwvcGF0aD48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNDAuNSAxNC45Vjcu"
2085
+ "NUgzMy4xVjEwLjVIMzcuNVYxNC45WiI+PC9wYXRoPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik03"
2086
+ "LjUgMzMuMVY0MC41SDE0LjlWMzcuNUgxMC41VjMzLjFaIj48L3BhdGg+PHBhdGggZmlsbD0i"
2087
+ "I2ZmZiIgZD0iTTQwLjUgMzMuMVY0MC41SDMzLjFWMzcuNUgzNy41VjMzLjFaIj48L3BhdGg+"
2088
+ "PGcgZmlsbD0iI2ZmZiI+PHJlY3QgeD0iMTkuOSIgeT0iMTYuNCIgd2lkdGg9IjIuODUiIGhl"
2089
+ "aWdodD0iMTAiIHJ4PSIxLjQyNSI+PC9yZWN0PjxyZWN0IHg9IjIzLjMiIHk9IjE0Ljc1IiB3"
2090
+ "aWR0aD0iMi44NSIgaGVpZ2h0PSIxMSIgcng9IjEuNDI1Ij48L3JlY3Q+PHJlY3QgeD0iMjYu"
2091
+ "NyIgeT0iMTUuNiIgd2lkdGg9IjIuODUiIGhlaWdodD0iMTAuNSIgcng9IjEuNDI1Ij48L3Jl"
2092
+ "Y3Q+PHJlY3QgeD0iMzAuMSIgeT0iMTcuOSIgd2lkdGg9IjIuODUiIGhlaWdodD0iOSIgcng9"
2093
+ "IjEuNDI1Ij48L3JlY3Q+PHBhdGggZD0iTTMyLjk1IDI0LjZWMjhDMzIuOTUgMzEgMzAuNiAz"
2094
+ "My4yNSAyNy42IDMzLjI1SDI1LjZDMjMgMzMuMjUgMTguNzEgMjguMjEgMTcuMjkgMjYuNTJR"
2095
+ "MTYuMiAyNS4yMiAxNS4xMSAyMy45MkExLjQyNSAxLjQyNSAwIDAgMSAxNy4yOSAyMi4wOFEx"
2096
+ "OC42IDIzLjY0IDE5LjkgMjUuMTlWMjQuNloiPjwvcGF0aD48L2c+PHBhdGggZmlsbD0iI2Zm"
2097
+ "ZiIgZD0iTTE2IDE1LjNRMTYuNjkgMTYuOTEgMTguMyAxNy42UTE2LjY5IDE4LjI5IDE2IDE5"
2098
+ "LjlRMTUuMzEgMTguMjkgMTMuNyAxNy42UTE1LjMxIDE2LjkxIDE2IDE1LjNaIj48L3BhdGg+"
2099
+ "PC9zdmc+PC9zdmc+"
2042
2100
  )
2043
2101
 
2044
2102
 
@@ -2063,13 +2121,35 @@ def nav_link(label: str, icon: str, href: str) -> rx.Component:
2063
2121
  )
2064
2122
 
2065
2123
 
2124
+ def footer_link(label: str, href: str) -> rx.Component:
2125
+ return rx.link(label, href=href, is_external=True, color=MUTED,
2126
+ text_decoration="underline", text_underline_offset="2px",
2127
+ _hover={"color": ACCENT})
2128
+
2129
+
2130
+ def footer() -> rx.Component:
2131
+ return rx.flex(
2132
+ rx.text("Codee is developed by ",
2133
+ footer_link("FuseBase", "https://thefusebase.com")),
2134
+ rx.text("·", aria_hidden="true"),
2135
+ footer_link("Source code on GitHub", "https://github.com/fusebase-dev/codee"),
2136
+ gap="0.5rem",
2137
+ wrap="wrap",
2138
+ align="center",
2139
+ color=MUTED,
2140
+ font_size="0.8rem",
2141
+ padding_top="1rem",
2142
+ border_top=BORDER,
2143
+ )
2144
+
2145
+
2066
2146
  def shell(content: rx.Component) -> rx.Component:
2067
2147
  return rx.box(
2068
2148
  rx.grid(
2069
2149
  rx.box(
2070
2150
  rx.vstack(
2071
2151
  rx.hstack(
2072
- rx.box(LOGO, color="white", background=ACCENT, width="2rem",
2152
+ rx.box(rx.html(LOGO), color="white", background=ACCENT, width="2rem",
2073
2153
  height="2rem", display="grid", place_items="center",
2074
2154
  border_radius="6px", font_weight="700",
2075
2155
  font_size="1.1rem", line_height="1"),
@@ -2116,7 +2196,9 @@ def shell(content: rx.Component) -> rx.Component:
2116
2196
  background=NAV_BACKGROUND,
2117
2197
  min_height=rx.breakpoints(initial="auto", lg="100vh"),
2118
2198
  ),
2119
- rx.box(content, padding=rx.breakpoints(initial="1.25rem", md="2rem", xl="3rem"),
2199
+ rx.box(rx.box(content, flex="1", width="100%"), footer(),
2200
+ padding=rx.breakpoints(initial="1.25rem", md="2rem", xl="3rem"),
2201
+ display="flex", flex_direction="column", gap="3rem",
2120
2202
  min_width="0", max_width="1440px", width="100%"),
2121
2203
  columns=rx.breakpoints(initial="1fr", lg="230px minmax(0, 1fr)"),
2122
2204
  min_height="100vh",
@@ -2515,6 +2597,20 @@ def claude_account_usage_row(account: ClaudeAccount) -> rx.Component:
2515
2597
  variant="soft", flex_shrink="0"),
2516
2598
  rx.fragment()),
2517
2599
  rx.spacer(),
2600
+ # Not on the live one, and not on one that cannot be signed in
2601
+ # with: there is nothing to switch to in either case.
2602
+ rx.cond(
2603
+ account.in_use | account.needs_reconnect,
2604
+ rx.fragment(),
2605
+ rx.button(
2606
+ "Set current", type="button", size="1", variant="soft",
2607
+ flex_shrink="0",
2608
+ loading=AdminState.claude_switching_account == account.id,
2609
+ disabled=AdminState.claude_switching_account != 0,
2610
+ title="Make this the account Claude Code runs on, and "
2611
+ "write its credentials into Claude Code's config",
2612
+ on_click=lambda: AdminState.use_claude_code_account(
2613
+ account.id))),
2518
2614
  spacing="2", align="center", width="100%",
2519
2615
  margin_bottom="0.6rem"),
2520
2616
  rx.cond(
@@ -2615,6 +2711,9 @@ def skill_card(skill: SkillSummary) -> rx.Component:
2615
2711
  rx.cond(skill.effort != "",
2616
2712
  rx.code(skill.effort, font_size="0.72rem",
2617
2713
  color_scheme="gray")),
2714
+ rx.cond(skill.context_tier != "",
2715
+ rx.code(skill.context_tier, font_size="0.72rem",
2716
+ color_scheme="gray", title="Context window")),
2618
2717
  spacing="2", align="center", width="100%",
2619
2718
  class_name="skill-card-meta"),
2620
2719
  rx.cond(
@@ -20,8 +20,10 @@ from dotenv import load_dotenv
20
20
  from codee_database import claude_code_accounts, oauth_tokens
21
21
  from codee_tasks_azure_devops import oauth as azure_oauth
22
22
  from codee_agent_abstract.provider import AbstractCodingAgent, AgentModel
23
+ from codee_agent_claude_code import credentials as claude_credentials
23
24
  from codee_agent_claude_code import oauth as claude_oauth
24
- from codee_agent_claude_code.account import AccountUnavailable, fetch_account
25
+ from codee_agent_claude_code.account import (
26
+ AccountUnavailable, fetch_account, fetch_profile)
25
27
  from codee_agent_claude_code.provider import ClaudeCodeAgent
26
28
  from codee_agent_claude_code.usage import (
27
29
  SESSION_WINDOW, WEEKLY_WINDOW, UsageRateLimited, UsageUnavailable,
@@ -640,11 +642,29 @@ def _skill_run_summary(
640
642
  if skill.effort:
641
643
  lines.append(f"Effort: {skill.effort}")
642
644
  if skill.context_tier:
643
- lines.append(f"Context: {skill.context_tier}")
645
+ lines.append(f"Context: {context_tier_label(skill.context_tier)}")
644
646
  lines.append(f"Skill: {skill.name}")
645
647
  return lines
646
648
 
647
649
 
650
+ def context_tier_label(tier: str) -> str:
651
+ """A skill's ``x-codee-context-tier:`` as a person reads it.
652
+
653
+ The window's own size ("1M") is only known from the agent's model catalog,
654
+ which takes a CLI run to read, so places that list skills say the tier.
655
+ """
656
+ return tier.replace("_", " ")
657
+
658
+
659
+ def _skill_model_line(skill: IssueTriggeredSkill) -> str:
660
+ """The model a skill runs on, with its effort and context tier when set."""
661
+ return " \u00b7 ".join(filter(None, [
662
+ skill.model or WORKFLOW_DEFAULT_MODEL_LABEL,
663
+ skill.effort,
664
+ context_tier_label(skill.context_tier),
665
+ ]))
666
+
667
+
648
668
  def _with_agent_tooltips(
649
669
  workflow: dict[str, Any],
650
670
  skills: list[IssueTriggeredSkill],
@@ -696,10 +716,10 @@ def _node_with_agent_tooltip(
696
716
  if lines:
697
717
  lines.append("")
698
718
  lines.extend(_skill_run_summary(skill, default_agent))
699
- # The models named under the status name on the node itself. Skills sharing
700
- # an entry status often ask for the same one, so it is said once.
701
- models = list(dict.fromkeys(
702
- skill.model or WORKFLOW_DEFAULT_MODEL_LABEL for skill in handled))
719
+ # The models named under the status name on the node itself, each with its
720
+ # effort and context tier. Skills sharing an entry status often ask for the
721
+ # same one, so it is said once.
722
+ models = list(dict.fromkeys(_skill_model_line(skill) for skill in handled))
703
723
  return {
704
724
  **node,
705
725
  "className": " ".join(
@@ -2462,6 +2482,57 @@ class AdminService:
2462
2482
  claude_code_accounts.remove_account(account_id, self.context)
2463
2483
  self._reconcile_claude_code_account()
2464
2484
 
2485
+ def use_claude_code_account(self, account_id: int) -> tuple[bool, str]:
2486
+ """Make one account the one in use, and sign the CLI in as it now.
2487
+
2488
+ Returns whether it worked and a sentence to show either way. Both
2489
+ halves are done here rather than left to the next rotation check: the
2490
+ pointer alone would only take effect up to five minutes later, and only
2491
+ in a running executor.
2492
+
2493
+ The token is renewed first, because an account waiting its turn holds
2494
+ one that may have expired hours ago. Its profile goes into
2495
+ ``.claude.json`` too, so the CLI names the account it is now running
2496
+ as instead of the previous one. That part is best-effort: the
2497
+ credentials are what makes the switch, and a profile that could not be
2498
+ read is fetched by the CLI itself on its next run.
2499
+ """
2500
+ try:
2501
+ stored = {account.id: account for account
2502
+ in claude_code_accounts.accounts(self.context)}
2503
+ except Exception as error: # noqa: BLE001 - the UI must never see a traceback
2504
+ return False, f"Could not read the connected accounts: {error}"
2505
+ account = stored.get(account_id)
2506
+ if account is None:
2507
+ return False, "That account is no longer connected"
2508
+ name = account.label or f"account {account.id}"
2509
+ now = int(datetime.now(timezone.utc).timestamp() * 1000)
2510
+ if account.needs_reconnect(now):
2511
+ return False, f"{name} has to be connected again first"
2512
+
2513
+ try:
2514
+ account = ensure_fresh(account, self.context)
2515
+ # A renewal the API refused retires the account rather than
2516
+ # raising, so the only way to hear about it is to look again.
2517
+ renewed = {row.id: row for row
2518
+ in claude_code_accounts.accounts(self.context)}
2519
+ if renewed[account.id].needs_reconnect(now):
2520
+ return False, f"{name} has to be connected again first"
2521
+ claude_credentials.write_credentials(
2522
+ account.access_token, account.refresh_token,
2523
+ account.expires_at, account.scopes, account.subscription_type)
2524
+ claude_code_accounts.set_current_account(account.id, self.context)
2525
+ except Exception as error: # noqa: BLE001
2526
+ return False, f"Could not switch to {name}: {error}"
2527
+
2528
+ try:
2529
+ claude_credentials.write_oauth_account(
2530
+ fetch_profile(account.access_token))
2531
+ except Exception as error: # noqa: BLE001 - the switch itself landed
2532
+ print(f"[admin] Switched Claude Code to {name} but could not "
2533
+ f"record its profile: {error}")
2534
+ return True, f"Claude Code is now running as {name}"
2535
+
2465
2536
  def _reconcile_claude_code_account(self) -> None:
2466
2537
  """Point the current account at a connected one.
2467
2538
 
@@ -519,6 +519,84 @@ class AdminServiceClaudeCodeAccountsTest(unittest.TestCase):
519
519
  ["one@example.com"])
520
520
  self.assertTrue(accounts[0].in_use)
521
521
 
522
+ # A refresh window that will not have closed by the time the test runs.
523
+ NEVER_EXPIRES = 4102444800000 # 2100-01-01
524
+
525
+ def _claude_home(self) -> Path:
526
+ """Point the CLI's config at a temp dir, so nothing real is written."""
527
+ home = self.directory / "claude-home"
528
+ home.mkdir()
529
+ environment = patch.dict(os.environ, {"CLAUDE_CONFIG_DIR": str(home)})
530
+ environment.start()
531
+ self.addCleanup(environment.stop)
532
+ return home
533
+
534
+ def test_setting_an_account_current_signs_the_cli_in_as_it(self) -> None:
535
+ home = self._claude_home()
536
+ (home / ".claude.json").write_text(json.dumps(
537
+ {"oauthAccount": {"emailAddress": "one@example.com"}}))
538
+ self._connect("one@example.com")
539
+ second_tokens = claude_oauth.Tokens(
540
+ "access-2", "refresh-2", expires_at=1789300823639,
541
+ refresh_expires_at=self.NEVER_EXPIRES, scopes=("user:profile",),
542
+ subscription_type="pro")
543
+ self._connect("two@example.com", tokens=second_tokens)
544
+ second = self.service.claude_code_accounts()[1]
545
+
546
+ with patch("codee.admin_service.ensure_fresh",
547
+ side_effect=lambda a, c: a), \
548
+ patch("codee.admin_service.fetch_profile", return_value={
549
+ "account": {"uuid": "acc-2",
550
+ "email": "two@example.com"}}):
551
+ switched, message = self.service.use_claude_code_account(second.id)
552
+
553
+ self.assertTrue(switched, message)
554
+ self.assertTrue(self.service.claude_code_accounts()[1].in_use)
555
+ oauth = json.loads((home / ".credentials.json").read_text())[
556
+ "claudeAiOauth"]
557
+ self.assertEqual(oauth["accessToken"], "access-2")
558
+ self.assertEqual(oauth["refreshToken"], "refresh-2")
559
+ self.assertEqual(oauth["subscriptionType"], "pro")
560
+ self.assertEqual(
561
+ json.loads((home / ".claude.json").read_text())["oauthAccount"],
562
+ {"accountUuid": "acc-2", "emailAddress": "two@example.com"})
563
+
564
+ def test_an_unreadable_profile_does_not_undo_the_switch(self) -> None:
565
+ home = self._claude_home()
566
+ self._connect("one@example.com", tokens=claude_oauth.Tokens(
567
+ "access-1", "refresh-1", expires_at=1789300823639,
568
+ refresh_expires_at=self.NEVER_EXPIRES))
569
+
570
+ with patch("codee.admin_service.ensure_fresh",
571
+ side_effect=lambda a, c: a), \
572
+ patch("codee.admin_service.fetch_profile",
573
+ side_effect=AccountUnavailable("no route")):
574
+ switched, _ = self.service.use_claude_code_account(
575
+ self.service.claude_code_accounts()[0].id)
576
+
577
+ self.assertTrue(switched)
578
+ self.assertTrue((home / ".credentials.json").exists())
579
+
580
+ def test_an_account_that_needs_signing_in_again_is_not_switched_to(self) -> None:
581
+ home = self._claude_home()
582
+ expired = claude_oauth.Tokens(
583
+ "access-1", "refresh-1", expires_at=1, refresh_expires_at=1)
584
+ self._connect("one@example.com", tokens=expired)
585
+
586
+ switched, message = self.service.use_claude_code_account(
587
+ self.service.claude_code_accounts()[0].id)
588
+
589
+ self.assertFalse(switched)
590
+ self.assertIn("connected again", message)
591
+ self.assertFalse((home / ".credentials.json").exists())
592
+
593
+ def test_a_disconnected_account_is_not_switched_to(self) -> None:
594
+ self._claude_home()
595
+
596
+ switched, _ = self.service.use_claude_code_account(42)
597
+
598
+ self.assertFalse(switched)
599
+
522
600
  def test_disconnecting_an_account_forgets_its_tokens(self) -> None:
523
601
  self._connect()
524
602
  account = self.service.claude_code_accounts()[0]
@@ -2235,6 +2313,25 @@ class AdminServiceWorkflowAgentTest(unittest.TestCase):
2235
2313
  "'claude-opus-5'",
2236
2314
  )
2237
2315
 
2316
+ def test_the_effort_and_context_tier_follow_the_model_on_the_node(
2317
+ self) -> None:
2318
+ with tempfile.TemporaryDirectory() as temporary_directory:
2319
+ service = self._service(
2320
+ Path(temporary_directory),
2321
+ "model: claude-opus-5\neffort: high\n"
2322
+ "x-codee-context-tier: long_context\nx-codee-agent: codex\n")
2323
+
2324
+ nodes = self._story_nodes(service)
2325
+
2326
+ self.assertEqual(
2327
+ nodes["Ready"]["style"]["--codee-node-model"],
2328
+ "'claude-opus-5 \u00b7 high \u00b7 long context'",
2329
+ )
2330
+ self.assertIn(
2331
+ "Context: long context",
2332
+ nodes["Ready"]["style"]["--codee-agent-run"],
2333
+ )
2334
+
2238
2335
  def test_a_skill_that_names_neither_falls_back_to_what_runs_it(self) -> None:
2239
2336
  with tempfile.TemporaryDirectory() as temporary_directory:
2240
2337
  root = Path(temporary_directory)
@@ -31,6 +31,21 @@ def fetch_account(access_token: str) -> str:
31
31
 
32
32
  Raises :class:`AccountUnavailable` when there is no answer to show.
33
33
  """
34
+ label = read_account(fetch_profile(access_token))
35
+ if not label:
36
+ raise AccountUnavailable("the profile named no account")
37
+ return label
38
+
39
+
40
+ def fetch_profile(access_token: str) -> dict:
41
+ """The whole profile response for one key: the account and its organization.
42
+
43
+ What :func:`fetch_account` reads its label from, and what signing the CLI
44
+ in needs in full — it records the account's ids and organization next to
45
+ the token, not just the email.
46
+
47
+ Raises :class:`AccountUnavailable` when there is no answer to read.
48
+ """
34
49
  try:
35
50
  response = oauth.get(PROFILE_PATH, access_token)
36
51
  except oauth.OAuthApiError as error:
@@ -47,10 +62,7 @@ def fetch_account(access_token: str) -> str:
47
62
  if response.status_code in (401, 403)
48
63
  else f"HTTP {response.status_code}{detail}")
49
64
 
50
- label = read_account(response.payload)
51
- if not label:
52
- raise AccountUnavailable("the profile named no account")
53
- return label
65
+ return response.payload
54
66
 
55
67
 
56
68
  def read_account(payload: dict) -> str: