[PR #77] feat(thinking): harden defaults and unify guard/retry behavior #77

Open
opened 2026-02-27 07:17:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jwadow/kiro-gateway/pull/77
Author: @sametakofficial
Created: 2/11/2026
Status: 🔄 Open

Base: mainHead: main


📝 Commits (8)

  • b3e8782 feat(thinking): add request-driven thinking policy and social-token auth routing
  • b54f930 docs: add feature-focused update summary and minimal env template
  • 3b9ab69 feat(thinking): align parser with request-level policy and document anthropic high/max
  • bad7d8a Merge remote-tracking branch 'origin/main'
  • 806c869 docs: move handoff context to root and add fork purpose section
  • bc66e6d feat(thinking): harden defaults and unify guard/retry handling
  • e1ae6e7 docs: reorganize fork documentation under fork-docs
  • ee456bb Merge branch 'jwadow:main' into main

📊 Changes

49 files changed (+16458 additions, -6877 deletions)

View changed files

📝 .env.example (+144 -3)
📝 README.md (+21 -0)
fork-docs/ARCHITECTURE_AUDIT.md (+67 -0)
fork-docs/CHANGES_CONTEXT_FULL.md (+210 -0)
fork-docs/FORK_CHANGELOG.md (+192 -0)
fork-docs/HANDOFF_THINKING_POLICY_MIGRATION.md (+1138 -0)
fork-docs/KIRO_API_REVERSE_ENGINEERED.md (+206 -0)
fork-docs/PROMPT_KIRO_GATEWAY_DEEP_AUDIT_TR.md (+209 -0)
fork-docs/PR_REVIEW_SUMMARY.md (+52 -0)
fork-docs/SECURITY_REVIEW.md (+58 -0)
📝 kiro/auth.py (+340 -240)
📝 kiro/config.py (+307 -28)
📝 kiro/converters_anthropic.py (+15 -4)
📝 kiro/converters_core.py (+918 -373)
📝 kiro/converters_openai.py (+101 -75)
📝 kiro/http_client.py (+114 -83)
📝 kiro/kiro_errors.py (+21 -18)
kiro/middleware/__init__.py (+38 -0)
kiro/middleware/message_structure_validator.py (+188 -0)
kiro/middleware/payload_size_guard.py (+271 -0)

...and 29 more files

📄 Description

Summary

  • Add request-driven thinking policy plumbing and strengthen social-token auth compatibility for real-world kiro-cli/SDK flows.
  • Introduce configurable middleware + payload guard pipeline to reduce opaque upstream Improperly formed request failures while keeping operator toggles explicit.
  • Harden startup security posture by rejecting insecure default PROXY_API_KEY and requiring explicit SKIP_AUTH_ACKNOWLEDGED=true when SKIP_AUTH=true.
  • Unify reactive retry handling across OpenAI and Anthropic routes and consolidate fork documentation under fork-docs/.

Testing

  • pytest -q -> 1501 passed

Notes

  • This PR keeps transparent-proxy behavior configurable via environment toggles and focuses on reliability/security hardening rather than API-surface changes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jwadow/kiro-gateway/pull/77 **Author:** [@sametakofficial](https://github.com/sametakofficial) **Created:** 2/11/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (8) - [`b3e8782`](https://github.com/jwadow/kiro-gateway/commit/b3e878283cf8d72aba5b861391d0d29c0d953c54) feat(thinking): add request-driven thinking policy and social-token auth routing - [`b54f930`](https://github.com/jwadow/kiro-gateway/commit/b54f9303dbbd657f4bb67034d61cb04a9443a11f) docs: add feature-focused update summary and minimal env template - [`3b9ab69`](https://github.com/jwadow/kiro-gateway/commit/3b9ab69597f5382d1ad3ad684b1d43183d34d66b) feat(thinking): align parser with request-level policy and document anthropic high/max - [`bad7d8a`](https://github.com/jwadow/kiro-gateway/commit/bad7d8a3e7d97349edc1931b1dba941506daad66) Merge remote-tracking branch 'origin/main' - [`806c869`](https://github.com/jwadow/kiro-gateway/commit/806c869b67a88b609fb374566e5b33b459df8711) docs: move handoff context to root and add fork purpose section - [`bc66e6d`](https://github.com/jwadow/kiro-gateway/commit/bc66e6db19413667baa5e68ebd385ba93ba6e0a8) feat(thinking): harden defaults and unify guard/retry handling - [`e1ae6e7`](https://github.com/jwadow/kiro-gateway/commit/e1ae6e72e2860cfc880d560b315568822db80252) docs: reorganize fork documentation under fork-docs - [`ee456bb`](https://github.com/jwadow/kiro-gateway/commit/ee456bb960ec0ca8c22caad76077810f354c485a) Merge branch 'jwadow:main' into main ### 📊 Changes **49 files changed** (+16458 additions, -6877 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+144 -3) 📝 `README.md` (+21 -0) ➕ `fork-docs/ARCHITECTURE_AUDIT.md` (+67 -0) ➕ `fork-docs/CHANGES_CONTEXT_FULL.md` (+210 -0) ➕ `fork-docs/FORK_CHANGELOG.md` (+192 -0) ➕ `fork-docs/HANDOFF_THINKING_POLICY_MIGRATION.md` (+1138 -0) ➕ `fork-docs/KIRO_API_REVERSE_ENGINEERED.md` (+206 -0) ➕ `fork-docs/PROMPT_KIRO_GATEWAY_DEEP_AUDIT_TR.md` (+209 -0) ➕ `fork-docs/PR_REVIEW_SUMMARY.md` (+52 -0) ➕ `fork-docs/SECURITY_REVIEW.md` (+58 -0) 📝 `kiro/auth.py` (+340 -240) 📝 `kiro/config.py` (+307 -28) 📝 `kiro/converters_anthropic.py` (+15 -4) 📝 `kiro/converters_core.py` (+918 -373) 📝 `kiro/converters_openai.py` (+101 -75) 📝 `kiro/http_client.py` (+114 -83) 📝 `kiro/kiro_errors.py` (+21 -18) ➕ `kiro/middleware/__init__.py` (+38 -0) ➕ `kiro/middleware/message_structure_validator.py` (+188 -0) ➕ `kiro/middleware/payload_size_guard.py` (+271 -0) _...and 29 more files_ </details> ### 📄 Description ## Summary - Add request-driven thinking policy plumbing and strengthen social-token auth compatibility for real-world `kiro-cli`/SDK flows. - Introduce configurable middleware + payload guard pipeline to reduce opaque upstream `Improperly formed request` failures while keeping operator toggles explicit. - Harden startup security posture by rejecting insecure default `PROXY_API_KEY` and requiring explicit `SKIP_AUTH_ACKNOWLEDGED=true` when `SKIP_AUTH=true`. - Unify reactive retry handling across OpenAI and Anthropic routes and consolidate fork documentation under `fork-docs/`. ## Testing - `pytest -q` -> `1501 passed` ## Notes - This PR keeps transparent-proxy behavior configurable via environment toggles and focuses on reliability/security hardening rather than API-surface changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/kiro-gateway-jwadow#77
No description provided.