Repository navigation
Conversation
7 of 10 tasks
Qiao-yq
force-pushed
the
feat/ai-1539-context-compiler-core
branch
from
October 25, 2026 13:56
2a51ff9 to
923916a
Compare
Qiao-yq
marked this pull request as ready for review
October 26, 2026 01:38
7 of 10 tasks
The quoted-value branch of the credential assignment rule stopped at an escaped quote, leaving the remaining credential suffix visible to the model. Match escape pairs inside double- and single-quoted values so the whole value is redacted. Add regressions for SanitizeText and the modelInputView boundary covering escaped quotes and backslashes.
# Conflicts: # ai/store/memory/store_test.go
Run shared JWKS refreshes on a detached, bounded context so a client disconnecting cannot abort the fetch or start the failure cooldown for other callers. Apply the public-probe exemption in the authentication middleware actually used by the Router, and add regressions through the real Router and a canceled refresh initiator.
Add regressions requested in the PR 1610 review: same-tenant session administrators must compile owner context, read/restore the ledger, and append canonical tool batches whose owner remains the Session owner. Administrator-owned batches and ordinary same-tenant callers stay denied.
Author
|
Updated head to Dependency sync — merged the latest #1609 ( Session owner vs. acting subject (P2, larry-zy) — fixed in
JSON fail-open (P2, AlexStocks) — P3 follow-ups — in
Re-review welcome. |
…lifecycle # Conflicts: # ai/component/agent/react/react.go # ai/component/memory/component.go # ai/component/server/component.go # ai/component/server/config_test.go # ai/component/server/engine/handlers.go # ai/component/server/engine/models.go # ai/component/server/engine/router.go # ai/component/server/engine/session/session.go # ai/store/gorm/models.go # ai/store/gorm/store.go # ai/store/gorm/store_test.go # ai/store/memory/store.go # ai/store/memory/store_test.go # ai/store/store.go # ai/store/validation.go
…into fix/ai-1539-context-window
… feat/ai-1539-production-auth-usage-audit
…ge-audit' into feat/ai-1539-context-compiler-core
|
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Please provide a description of this PR:
Draft. This PR is blocked by and must be merged after #1609 and its prerequisites #1596 and #1608. Merge order: #1596 → #1608 → #1609 → this PR. Complete the Phase 1 prerequisites and G1 acceptance before merging this production integration.
Implement Phase 2 foundations / Core MVP PR 1: unified context contracts, versioned templates, complete-request budgets, and canonical tool interactions for #1539. This follows the Phase 1 security, Session lifecycle, authentication, and usage/audit foundations; it provides the compilation path needed by later conversation-summary and cross-session-memory work.
Previously, ReAct assembled prompts separately and stored tool results without a complete recoverable request/result association. This PR compiles each Act and Answer request through one bounded path, and retains canonical tool records that can be restored after failed or cancelled attempts.
max_collect_bytes) from rendered request limits (max_context_bytes); sanitize and bound tool-result views before final selection, keeping call IDs, arguments, statuses, and native request/result pairing intactminimalrollback modeCompatibility: production Agent construction now requires
NewReActAgentWithStoreand aCompilationStore; the old constructor without storage returns an explicit migration error. GORM migration adds the tool ledger, Session template reference, and context-estimate metadata. Legacy tool results remain labeled evidence; missing requests or call IDs are not invented. Stored canonical records are not rewritten by model-input sanitization or result trimming.This is the first Core MVP PR, not completion of the entire Phase 2 scope or #1539. Summary persistence, cross-session Memory, frontend controls, and a dynamic plugin platform are deferred. The three local planning documents are not included in these commits.
While the dependencies are open, GitHub's comparison against
aiincludes their changes. Review this PR's six functional commits on top of the Phase 1 baseline here.Validation from
ai/(test cache disabled):go test -count=1 ./...go test -race -count=1 ./component/context ./component/agent/react ./component/agent/react/test ./store/...git diff --check 8459ec4..HEADRegression tests inspect actual OpenAI-compatible HTTP Provider requests for multi-tool pairing, partial success followed by cancellation, retries and restarts, archived-template variable changes, and approximately 100 KB tool results fitting a 16 KB request budget after trimming. They also check retained canonical payloads, uncertainty, sanitization, Source isolation, and explicit mandatory-budget failures.
Provider tests use a local HTTP fixture and GORM tests use SQLite. Real-model behavior and production MySQL/PostgreSQL acceptance remain unverified; these checks do not establish the Phase 1 G1 gate.
Part of #1539. Blocked by #1596, #1608, and #1609.
To help us figure out who should review this PR, please put an X in all the areas that this PR affects.
Please check any characteristics that apply to this pull request.