feat(dialects): Phase 1 A6 inband dialect layer#467
Open
quangdang46 wants to merge 8 commits into
Open
Conversation
Add consolidated PR backlog from 13 reference repos (A-J, ~80 features) and supporting docs (MASTER_GOAL_PROMPT, GOAL_DRIVEN_PROMPT, CONSOLIDATED_FINDINGS).
Adds core InbandScanner trait, event types, and 3 fully-implemented dialects (Hermes JSON-tag, Kimi token-delimited, Gemini Python-fence) with 12 passing tests. 9 remaining dialects fall back to Hermes scanner. Refs: docs/pr-plans/A6-inband-dialects.md
Adds model-family-aware prompt resolution so the system prompt is tuned to the active model's instruction-following profile. - PromptVariant enum with Claude/Gpt/Gemini/Default variants - resolve_prompt_variant(model_id) prefix-based resolution - system_prompt_for_model(model_id) convenience function - Per-model markdown files: system_prompt_claude.md, system_prompt_gpt.md, system_prompt_gemini.md - Wired into prompting.rs via model_id parameter - Wired into both build_system_prompt_full and build_system_prompt_split Refs: docs/pr-plans/C3-prompt-variants.md
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.
Summary
Implements Phase 1 of A6: the inband (streaming) tool-call dialect layer for non-JSON LLM providers.
Changes
Core types (new
crates/jcode-llm-dialects/src/types.rs):InbandScanEventenum (7 variants: Text, ThinkingStart, ThinkingDelta, ThinkingEnd, ToolStart, ToolArgDelta, ToolEnd)InbandScannertrait (feed, flush)Dialectenum (12 variants)InbandScannerOptionsstruct3 dialects fully implemented:
HermesInbandScanner(hermes.rs) — JSON-in-<tool_call>tags, optional<think>blocks. 4 tests.KimiInbandScanner(kimi.rs) — Token-delimited<|tool_calls_section_begin|>markers, 5-state machine. 3 tests.GeminiInbandScanner(gemini.rs) — Python ````tool_code``` fence parser with keyword-arg deserialization. 5 tests (inc. Python value parsing).Factory (
lib.rs):create_inband_scanner()dispatcher +dialect_prompt()for prompt fragments.9 remaining dialects (Anthropic, DeepSeek, Gemma, GLM, Harmony, MiniMax, Qwen3, Xml) currently fall back to Hermes scanner — ready for transition to full implementations in Phase 2.
Verification
cargo test -p jcode-llm-dialects— 12/12 passcargo check— clean (warnings: unusedgen_idin kimi.rs, expected until Phase 2)Refs: docs/pr-plans/A6-inband-dialects.md