Commit Graph

26 Commits

Author SHA1 Message Date
jnjpng
39b25a0e3c fix: update ContextWindowCalculator to parse new system message sections (#9398)
* fix: update ContextWindowCalculator to parse new system message sections

The context window calculator was using outdated position-based parsing
that only handled 3 sections (base_instructions, memory_blocks, memory_metadata).
The actual system message now includes additional sections that were not
being tracked:

- <memory_filesystem> (git-enabled agents)
- <tool_usage_rules> (when tool rules configured)
- <directories> (when sources attached)

Changes:
- Add _extract_tag_content() helper for proper XML tag extraction
- Rewrite extract_system_components() to return a Dict with all 6 sections
- Update calculate_context_window() to count tokens for new sections
- Add new fields to ContextWindowOverview schema with backward-compatible defaults
- Add unit tests for the extraction logic

* update

* generate

* fix: check attached file in directories section instead of core_memory

Files are rendered inside <directories> tags, not <memory_blocks>.
Update validate_context_window_overview assertions accordingly.

* fix: address review feedback for context window parser

- Fix git-enabled agents regression: capture bare file blocks
  (e.g. <system/human.md>) rendered after </memory_filesystem> as
  core_memory via new _extract_git_core_memory() method
- Make _extract_top_level_tag robust: scan all occurrences to find
  tag outside container, handling nested-first + top-level-later case
- Document system_prompt tag inconsistency in docstring
- Add TODO to base_agent.py extract_dynamic_section linking to
  ContextWindowCalculator to flag parallel parser tech debt
- Add tests: git-enabled agent parsing, dual-occurrence tag
  extraction, pure text system prompt, git-enabled integration test
2026-02-24 10:52:07 -08:00
cthomas
0ecf72567a test: migrate sources test to 1.0 sdk [LET-6317] (#6367)
* test: migrate sources test to 1.0 sdk

* fix dict attribute access
2025-11-26 14:39:39 -08:00
Matthew Zhou
155fa9c734 fix: Fix agent tool graph tests (#4948)
Fix agent tool graph tests
2025-10-07 17:50:46 -07:00
Kian Jones
b8e9a80d93 merge this (#4759)
* wait I forgot to comit locally

* cp the entire core directory and then rm the .git subdir
2025-09-17 15:47:40 -07:00
Kian Jones
22f70ca07c chore: officially migrate to submodule (#4502)
* remove apps/core and apps/fern

* fix precommit

* add submodule updates in workflows

* submodule

* remove core tests

* update core revision

* Add submodules: true to all GitHub workflows

- Ensure all workflows can access git submodules
- Add submodules support to deployment, test, and CI workflows
- Fix YAML syntax issues in workflow files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* remove core-lint

* upgrade core with latest main of oss

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 12:45:53 -07:00
Kian Jones
fecf6decfb chore: migrate to ruff (#4305)
* base requirements

* autofix

* Configure ruff for Python linting and formatting

- Set up minimal ruff configuration with basic checks (E, W, F, I)
- Add temporary ignores for common issues during migration
- Configure pre-commit hooks to use ruff with pass_filenames
- This enables gradual migration from black to ruff

* Delete sdj

* autofixed only

* migrate lint action

* more autofixed

* more fixes

* change precommit

* try changing the hook

* try this stuff
2025-08-29 11:11:19 -07:00
Matthew Zhou
9871bffdf2 fix: Add check status update flag to list (#4177) 2025-08-25 16:21:33 -07:00
Matthew Zhou
2ceb144afb feat: Add better error catching for files upload (#4145) 2025-08-24 16:46:57 -07:00
Matthew Zhou
a07c47b5b3 fix: Fix bugs with exporting/importing agents with files (#4089) 2025-08-21 16:23:37 -07:00
Kian Jones
5b70d554bb fix(ci): redo agentfile upload util and tweak secret (#4033) 2025-08-20 15:37:06 -07:00
Kian Jones
6731f769ca test(include_pings): Add long-running tests (#3899) 2025-08-14 18:13:47 -07:00
Kevin Lin
bba9753e1c fix: update default include_base_tool_rules to None (#3762)
Co-authored-by: Matthew Zhou <mattzh1314@gmail.com>
2025-08-06 15:58:29 -07:00
Kevin Lin
99c479cd78 feat: add max files and file open window to system prompt (#3515) 2025-07-23 17:05:53 -07:00
Matthew Zhou
80b3356945 feat: Make get context window much more efficient (#3292) 2025-07-11 11:28:07 -07:00
Kevin Lin
3540bda050 feat: move file name to property (#3091) 2025-06-30 14:06:09 -07:00
Matthew Zhou
ebccd8176a fix: Add additional testing for anthropic token counting (#2619) 2025-06-03 20:56:39 -07:00
Matthew Zhou
1baa124c76 feat: Add file status to core memory jinja template (#2604) 2025-06-03 15:07:21 -07:00
Kevin Lin
d0519437af feat: display file blocks with xml tags (#2559)
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-06-03 13:52:29 -07:00
Matthew Zhou
917821a735 refactor: Deprecate local client (#2344) 2025-05-22 18:57:14 -07:00
Matthew Zhou
7f345a0fdb fix: Remove flaky multi agent test (#1443) 2025-03-27 16:29:13 -07:00
Matthew Zhou
f0ba8bbb1f feat: Make multi agent broadcast directly invoke step (#1355) 2025-03-20 17:05:04 -07:00
Matthew Zhou
ca43ffb474 feat: Add message_buffer_autoclear field to Agent (#978) 2025-02-12 15:06:56 -08:00
cthomas
f5bcef2657 chore: rename metadata_ field to metadata in pydantic (#732) 2025-01-22 19:05:41 -08:00
Matthew Zhou
e6fdf80971 fix: Add retry decorator to stochastic tests (#678) 2025-01-16 11:17:06 -08:00
Matthew Zhou
9cd326ddb8 feat: Allow per-agent tool execution environment variables (#509) 2025-01-05 21:06:38 -08:00
Shubham Naik
5a743d1dc4 Add 'apps/core/' from commit 'ea2a7395f4023f5b9fab03e6273db3b64a1181d5'
git-subtree-dir: apps/core
git-subtree-mainline: a8963e11e7a5a0059acbc849ce768e1eee80df61
git-subtree-split: ea2a7395f4023f5b9fab03e6273db3b64a1181d5
2024-12-22 20:31:22 -08:00