Commit Graph
5016 Commits
Author SHA1 Message Date
Alex ca5f80995d fix: accurate per-call token usage and oversized-context guards
Token accounting:
- Drain each tool round's provider stream to exhaustion before running
  tools and recursing, so the usage decorator persists exactly one
  token_usage row per LLM call, at call end. Previously every round's
  generator was abandoned mid-iteration and flushed together at request
  teardown, writing N near-identical rows stamped with the final
  round's provider counts (duplicate billing).
- Consume the Chat Completions include_usage terminal chunk (it arrives
  after finish_reason and was never read) so streamed calls record
  provider-exact token counts instead of tiktoken estimates.
- Claim provider-reported usage once per call (_last_usage_claimed) so
  a late-finalized generator can never adopt another call's counts.

Oversized-context guards:
- Enforce Responses API function_call/function_call_output pairing in
  the input builder (drop unpaired items; bypassed for store-mode
  previous_response_id chaining where calls are matched server-side).
- Hard pre-send context gate: shrink oversized tool results and refuse
  payloads that cannot fit the model's window before dispatch, so a
  hopeless request is never sent or billed.
- Cap a single tool result entering the LLM context
  (TOOL_RESULT_MAX_TOKENS, default 20000); the tool journal and
  persistence keep the full result. Applied on the resume/continuation
  path too.
- Skip the fallback attempt when the payload cannot fit the fallback
  model's context window (10% estimation slack).
- Compression: never save a compression point that does not reduce
  tokens; bound oversized verbatim fields kept after a compression
  point (COMPRESSION_RECENT_FIELD_MAX_TOKENS, default 8000).

Robustness fixes from review:
- Google parallel function calls: complete index-less ToolCalls are no
  longer merged into one another (dict arguments raised TypeError on
  +=; second call could execute with the first call's arguments).
- Trailing-frame failures after a delivered answer no longer error the
  stream or restream the whole answer from the fallback
  (_stream_reached_finish).
- In-memory compression falls back to minimal pruning when the summary
  is not smaller than the original.
- keep<=0 guard in the middle-truncation helpers (a tiny cap returned
  marker + full text).

Frontend: tooltip on the Analytics tokens stat card explaining that
agent tool loops re-send conversation context on every step.
2026-07-15 21:20:39 +01:00
Alex a7fd6d7c02 feat: update docs 2026-07-15 10:31:43 +01:00
Alex 73c3dfb5c4 Merge pull request #2593 from arc53/endpoint-improvements
Endpoint improvements
2026-07-13 11:15:48 +02:00
Alex bc68adf894 feat: CI speedup 2026-07-13 10:08:28 +01:00
Alex a1d175ad36 fix: minor string / e 2026-07-13 09:50:11 +01:00
Alex f33bdaa52d fix: minor usage tracking improvements 2026-07-13 09:38:17 +01:00
Alex 0adf88abed feat: improved compatability layer and responses api handing 2026-07-13 09:37:58 +01:00
Alex 3e978759de Merge pull request #2568 from arc53/artifacts-and-code-executors
Artifacts and sandboxed code execution: tools, workflows, and document I/O
2026-07-10 15:33:28 +02:00
Alex a541bbd996 feat: minor workflow fix 2026-07-09 20:59:41 +01:00
Alex e4c0c26927 fix: more sandbox protections to terminate plus max pages 2026-07-09 19:56:13 +01:00
Alex 9f19bc64b5 fix: minor parser and id hardening 2026-07-09 18:43:48 +01:00
dependabot[bot] b5a14416d5 chore(deps-dev): bump lint-staged from 16.4.0 to 17.0.8 in /frontend (#2544)
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 16.4.0 to 17.0.8.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lint-staged/lint-staged/compare/v16.4.0...v17.0.8)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-version: 17.0.7
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-09 19:28:25 +05:30
dependabot[bot] 8de7e9efc3 chore(deps): bump radix-ui from 1.4.3 to 1.6.2 in /frontend (#2543)
Bumps [radix-ui](https://github.com/radix-ui/primitives/tree/HEAD/packages/react/radix-ui) from 1.4.3 to 1.6.2.
- [Changelog](https://github.com/radix-ui/primitives/blob/main/packages/react/radix-ui/CHANGELOG.md)
- [Commits](https://github.com/radix-ui/primitives/commits/HEAD/packages/react/radix-ui)

---
updated-dependencies:
- dependency-name: radix-ui
  dependency-version: 1.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-09 19:23:41 +05:30
dependabot[bot] 942133fa31 chore(deps): bump date-fns from 4.2.1 to 4.4.0 in /frontend (#2542)
Bumps [date-fns](https://github.com/date-fns/date-fns) from 4.2.1 to 4.4.0.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Commits](https://github.com/date-fns/date-fns/compare/v4.2.1...v4.4.0)

---
updated-dependencies:
- dependency-name: date-fns
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-09 19:19:11 +05:30
dependabot[bot] 5abc87977a chore(deps-dev): bump @tailwindcss/postcss in /frontend (#2541)
Bumps [@tailwindcss/postcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-postcss) from 4.2.4 to 4.3.2.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.3.2/packages/@tailwindcss-postcss)

---
updated-dependencies:
- dependency-name: "@tailwindcss/postcss"
  dependency-version: 4.3.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-09 19:12:39 +05:30
dependabot[bot] ed62e0250e chore(deps-dev): bump vitest from 3.2.4 to 4.1.9 in /frontend (#2540)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 3.2.4 to 4.1.9.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.9/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-version: 4.1.9
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-09 18:40:00 +05:30
Alex 223a7588aa feat: small qol in fe 2026-07-09 13:03:57 +01:00
Alex 6dd5cf472a feat: improve workflow agent tool interation 2026-07-09 10:22:44 +01:00
Alex 51dc49f0d8 feat: qol agent easier schema and better logs 2026-07-09 00:11:27 +01:00
Alex 7f57e06531 feat: multi select chip bug 2026-07-08 23:00:44 +01:00
Alex c3de3e47de Merge remote-tracking branch 'origin/main' into artifacts-and-code-executors
# Conflicts:
#	frontend/src/agents/workflow/WorkflowBuilder.tsx
2026-07-08 21:54:09 +01:00
Alex 89eb3f68fc fix: remove mcp artefacts, handle non fatal issues on workflow
gracefully
2026-07-08 21:05:40 +01:00
Alex 12dfefdd05 fix: clean up and better artefact consistency 2026-07-08 20:06:31 +01:00
Alex 66786c2760 fix: remove code exec as default and sec improvements 2026-07-08 18:50:10 +01:00
Alex e80cc2a282 Merge branch 'main' of https://github.com/arc53/DocsGPT 2026-07-08 00:29:28 +01:00
Alex 748975ae95 fix: clean up comments 2026-07-08 00:25:35 +01:00
Alex 83c560f626 feat: mini replay improvements 2026-07-08 00:23:32 +01:00
Pavel 9e87b7b01a Merge pull request #2582 from ManishMadan2882/main
(feat)workflows: add undo/redo
+ workflow fixes
2026-07-07 23:15:05 +03:00
ManishMadan2882 e9c377378c (fixes)worflow: gracefully handle delete on key event 2026-07-08 00:57:58 +05:30
Alex 41affdf1f5 feat: improve sse 2026-07-07 18:51:31 +01:00
ManishMadan2882 3356ca19a9 (feat)workflows: add undo/redo 2026-07-06 16:38:33 +05:30
Alex 08f758b06b Merge pull request #2571 from ManishMadan2882/main
UI refinement
2026-07-04 16:00:27 +02:00
Alex 2d79ff2227 feat: more QoL fixes 2026-07-04 15:48:40 +02:00
Alex 94a845aa82 fix: more artefact hardening 2026-07-04 11:42:27 +02:00
Alex 47cc0314af feat: more executor guards 2026-07-03 23:53:51 +02:00
Alex a0f10925af fix: artefact fixes 2026-07-03 20:16:31 +02:00
ManishMadan2882 e340fed164 (fix)sources popup: last item in the list squashed 2026-07-03 01:05:22 +05:30
Alex bd88dd6807 feat: scope artefacts on api 2026-07-01 20:34:27 +02:00
GH Action - Upstream Sync d0bf0be753 Merge branch 'main' of https://github.com/arc53/DocsGPT 2026-07-01 04:01:05 +00:00
Alex 75e07af78f fix: minor issue fixes 2026-06-30 18:36:06 +02:00
Manish Madan 46b7bb7fe8 Merge pull request #2574 from mmustafasenoglu/fix/vite-hmr-docker-windows
fix: enable Chokidar polling for Vite HMR in Docker on Windows
2026-06-30 17:31:20 +05:30
Alex 99484e02c8 fix: injection protections and concurrency improvements 2026-06-29 19:56:10 +02:00
Alex b144265094 fix: workflow security pass 2026-06-29 19:21:35 +02:00
Alex da1cff5008 feat: better code exec tool calling 2026-06-29 13:11:51 +02:00
ManishMadan2882 3dc4887c6d (feat)message-input: scrollbar 2026-06-29 16:15:25 +05:30
Alex ec39836ff6 feat: gated prompt for artefacts 2026-06-28 19:21:07 +02:00
Alex 3254543292 feat: docs update on artifacts 2026-06-27 18:12:12 +02:00
GH Action - Upstream Sync 8be8029676 Merge branch 'main' of https://github.com/arc53/DocsGPT 2026-06-27 03:34:04 +00:00
Mustafa Senoglu bb2a8caddc fix: enable Chokidar polling for Vite HMR in Docker on Windows
Native fs events do not propagate from Windows hosts into Linux
containers, causing Vite's HMR to stop detecting file changes.

When the DOCKER environment variable is set, Chokidar now falls back
to polling with a 300ms interval, which reliably detects changes
across the Docker volume mount boundary.

Fixes #2456
2026-06-26 18:02:42 +03:00
Alex 71387917ec Merge branch 'main' of https://github.com/arc53/DocsGPT 2026-06-26 11:34:04 +01:00