aru-code 0.24.0__tar.gz → 0.24.1__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 (69) hide show
  1. {aru_code-0.24.0/aru_code.egg-info → aru_code-0.24.1}/PKG-INFO +1 -1
  2. aru_code-0.24.1/aru/__init__.py +1 -0
  3. {aru_code-0.24.0 → aru_code-0.24.1}/aru/cli.py +3 -1
  4. {aru_code-0.24.0 → aru_code-0.24.1}/aru/runtime.py +3 -0
  5. {aru_code-0.24.0 → aru_code-0.24.1}/aru/tools/codebase.py +16 -0
  6. {aru_code-0.24.0 → aru_code-0.24.1/aru_code.egg-info}/PKG-INFO +1 -1
  7. {aru_code-0.24.0 → aru_code-0.24.1}/pyproject.toml +1 -1
  8. aru_code-0.24.0/aru/__init__.py +0 -1
  9. {aru_code-0.24.0 → aru_code-0.24.1}/LICENSE +0 -0
  10. {aru_code-0.24.0 → aru_code-0.24.1}/README.md +0 -0
  11. {aru_code-0.24.0 → aru_code-0.24.1}/aru/agent_factory.py +0 -0
  12. {aru_code-0.24.0 → aru_code-0.24.1}/aru/agents/__init__.py +0 -0
  13. {aru_code-0.24.0 → aru_code-0.24.1}/aru/agents/base.py +0 -0
  14. {aru_code-0.24.0 → aru_code-0.24.1}/aru/agents/executor.py +0 -0
  15. {aru_code-0.24.0 → aru_code-0.24.1}/aru/agents/explorer.py +0 -0
  16. {aru_code-0.24.0 → aru_code-0.24.1}/aru/agents/planner.py +0 -0
  17. {aru_code-0.24.0 → aru_code-0.24.1}/aru/cache_patch.py +0 -0
  18. {aru_code-0.24.0 → aru_code-0.24.1}/aru/checkpoints.py +0 -0
  19. {aru_code-0.24.0 → aru_code-0.24.1}/aru/commands.py +0 -0
  20. {aru_code-0.24.0 → aru_code-0.24.1}/aru/completers.py +0 -0
  21. {aru_code-0.24.0 → aru_code-0.24.1}/aru/config.py +0 -0
  22. {aru_code-0.24.0 → aru_code-0.24.1}/aru/context.py +0 -0
  23. {aru_code-0.24.0 → aru_code-0.24.1}/aru/display.py +0 -0
  24. {aru_code-0.24.0 → aru_code-0.24.1}/aru/history_blocks.py +0 -0
  25. {aru_code-0.24.0 → aru_code-0.24.1}/aru/permissions.py +0 -0
  26. {aru_code-0.24.0 → aru_code-0.24.1}/aru/plugins/__init__.py +0 -0
  27. {aru_code-0.24.0 → aru_code-0.24.1}/aru/plugins/custom_tools.py +0 -0
  28. {aru_code-0.24.0 → aru_code-0.24.1}/aru/plugins/hooks.py +0 -0
  29. {aru_code-0.24.0 → aru_code-0.24.1}/aru/plugins/manager.py +0 -0
  30. {aru_code-0.24.0 → aru_code-0.24.1}/aru/plugins/tool_api.py +0 -0
  31. {aru_code-0.24.0 → aru_code-0.24.1}/aru/providers.py +0 -0
  32. {aru_code-0.24.0 → aru_code-0.24.1}/aru/runner.py +0 -0
  33. {aru_code-0.24.0 → aru_code-0.24.1}/aru/session.py +0 -0
  34. {aru_code-0.24.0 → aru_code-0.24.1}/aru/tools/__init__.py +0 -0
  35. {aru_code-0.24.0 → aru_code-0.24.1}/aru/tools/ast_tools.py +0 -0
  36. {aru_code-0.24.0 → aru_code-0.24.1}/aru/tools/gitignore.py +0 -0
  37. {aru_code-0.24.0 → aru_code-0.24.1}/aru/tools/mcp_client.py +0 -0
  38. {aru_code-0.24.0 → aru_code-0.24.1}/aru/tools/ranker.py +0 -0
  39. {aru_code-0.24.0 → aru_code-0.24.1}/aru/tools/tasklist.py +0 -0
  40. {aru_code-0.24.0 → aru_code-0.24.1}/aru_code.egg-info/SOURCES.txt +0 -0
  41. {aru_code-0.24.0 → aru_code-0.24.1}/aru_code.egg-info/dependency_links.txt +0 -0
  42. {aru_code-0.24.0 → aru_code-0.24.1}/aru_code.egg-info/entry_points.txt +0 -0
  43. {aru_code-0.24.0 → aru_code-0.24.1}/aru_code.egg-info/requires.txt +0 -0
  44. {aru_code-0.24.0 → aru_code-0.24.1}/aru_code.egg-info/top_level.txt +0 -0
  45. {aru_code-0.24.0 → aru_code-0.24.1}/setup.cfg +0 -0
  46. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_agents_base.py +0 -0
  47. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_checkpoints.py +0 -0
  48. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_cli.py +0 -0
  49. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_cli_advanced.py +0 -0
  50. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_cli_base.py +0 -0
  51. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_cli_completers.py +0 -0
  52. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_cli_new.py +0 -0
  53. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_cli_run_cli.py +0 -0
  54. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_cli_session.py +0 -0
  55. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_cli_shell.py +0 -0
  56. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_codebase.py +0 -0
  57. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_confabulation_regression.py +0 -0
  58. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_config.py +0 -0
  59. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_context.py +0 -0
  60. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_executor.py +0 -0
  61. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_gitignore.py +0 -0
  62. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_guardrails_scenarios.py +0 -0
  63. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_main.py +0 -0
  64. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_mcp_client.py +0 -0
  65. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_permissions.py +0 -0
  66. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_planner.py +0 -0
  67. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_plugins.py +0 -0
  68. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_providers.py +0 -0
  69. {aru_code-0.24.0 → aru_code-0.24.1}/tests/test_ranker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aru-code
3
- Version: 0.24.0
3
+ Version: 0.24.1
4
4
  Summary: A Claude Code clone built with Agno agents
5
5
  Author-email: Estevao <estevaofon@gmail.com>
6
6
  License-Expression: MIT
@@ -0,0 +1 @@
1
+ __version__ = "0.24.1"
@@ -199,7 +199,8 @@ async def run_cli(skip_permissions: bool = False, resume_id: str | None = None):
199
199
  # Apply tree_depth from config
200
200
  session._tree_max_depth = config.tree_depth
201
201
 
202
- # Wire file-mutation callback and atexit cleanup
202
+ # Wire session and file-mutation callback
203
+ ctx.session = session
203
204
  ctx.on_file_mutation = session.invalidate_context_cache
204
205
  atexit.register(lambda: cleanup_processes(ctx.tracked_processes))
205
206
 
@@ -745,6 +746,7 @@ async def run_oneshot(prompt: str, print_only: bool = False, skip_permissions: b
745
746
  if config.default_model:
746
747
  session.model_ref = config.default_model
747
748
 
749
+ ctx.session = session
748
750
  ctx.model_id = session.model_id
749
751
  small_ref = config.model_aliases.get("small") if config else None
750
752
  if not small_ref:
@@ -122,6 +122,9 @@ class RuntimeContext:
122
122
  # -- Plugins --
123
123
  plugin_manager: Any = None # aru.plugins.manager.PluginManager (lazy to avoid circular)
124
124
 
125
+ # -- Session --
126
+ session: Any = None # aru.session.Session (set by CLI, used for sub-agent cost tracking)
127
+
125
128
  # -- Checkpoints --
126
129
  checkpoint_manager: Any = None # aru.checkpoints.CheckpointManager (lazy)
127
130
 
@@ -1289,6 +1289,22 @@ Do not create documentation files unless explicitly asked.
1289
1289
  from aru.permissions import permission_scope
1290
1290
  with permission_scope(agent_perm):
1291
1291
  result = await sub.arun(task, stream=False)
1292
+ # Track sub-agent token usage in the session so cost is not underestimated.
1293
+ # We accumulate totals directly instead of calling track_tokens() because
1294
+ # track_tokens() also reads cache_patch globals (last_call_metrics) which
1295
+ # may belong to a different concurrent sub-agent — we must not touch last_*.
1296
+ if result and hasattr(result, "metrics") and result.metrics:
1297
+ try:
1298
+ session = get_ctx().session
1299
+ if session is not None:
1300
+ m = result.metrics
1301
+ session.total_input_tokens += getattr(m, "input_tokens", 0) or 0
1302
+ session.total_output_tokens += getattr(m, "output_tokens", 0) or 0
1303
+ session.total_cache_read_tokens += getattr(m, "cache_read_tokens", 0) or 0
1304
+ session.total_cache_write_tokens += getattr(m, "cache_write_tokens", 0) or 0
1305
+ session.api_calls += 1
1306
+ except (LookupError, AttributeError):
1307
+ pass
1292
1308
  if result and result.content:
1293
1309
  return _truncate_output(f"[{label}] {result.content}")
1294
1310
  return f"[{label}] Task completed but no output was returned."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aru-code
3
- Version: 0.24.0
3
+ Version: 0.24.1
4
4
  Summary: A Claude Code clone built with Agno agents
5
5
  Author-email: Estevao <estevaofon@gmail.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aru-code"
7
- version = "0.24.0"
7
+ version = "0.24.1"
8
8
  description = "A Claude Code clone built with Agno agents"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -1 +0,0 @@
1
- __version__ = "0.24.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes