From 024f57e6906c9f91d784bab4bff8d9a9268f296f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 04:36:46 +0000 Subject: [PATCH 1/3] Add default system prompt for gpt-oss models to discourage table output When a user communicates with gpt-oss models through the responses API and has no system prompt set (neither per-request instructions nor a default user instruction), inject a default system prompt that instructs the model to avoid formatting responses as tables unless explicitly asked. This only applies to gpt-oss models and does not overwrite any user-defined system prompts. Co-Authored-By: tony@opensecret.cloud --- src/web/responses/context_builder.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/web/responses/context_builder.rs b/src/web/responses/context_builder.rs index c85f9e3f..42933682 100644 --- a/src/web/responses/context_builder.rs +++ b/src/web/responses/context_builder.rs @@ -5,9 +5,16 @@ use crate::encrypt::decrypt_with_key; use crate::tokens::{count_tokens, model_max_ctx}; use crate::DBConnection; use serde_json::json; -use tracing::error; +use tracing::{debug, error}; use uuid::Uuid; +/// Default system prompt for gpt-oss models when no user-defined system prompt is set. +/// This model tends to produce excessive tables even for simple questions, so we +/// instruct it to avoid tables unless the user explicitly asks for them. +const GPT_OSS_DEFAULT_SYSTEM_PROMPT: &str = + "Do not format your responses as tables unless the user explicitly asks for a table. \ + Prefer clear, concise prose or lists when presenting information."; + #[derive(Debug, Clone)] pub struct ChatMsg { pub role: &'static str, @@ -46,6 +53,12 @@ pub fn build_prompt( let tok = default_instruction.prompt_tokens as usize; system_tokens = tok; Some((ROLE_SYSTEM, content, tok)) + } else if model.starts_with("gpt-oss") { + // For gpt-oss models, inject a default system prompt to discourage excessive table usage + debug!("No user instructions set for gpt-oss model, using default anti-table system prompt"); + let tok = count_tokens(GPT_OSS_DEFAULT_SYSTEM_PROMPT); + system_tokens = tok; + Some((ROLE_SYSTEM, GPT_OSS_DEFAULT_SYSTEM_PROMPT.to_string(), tok)) } else { None }; From 65ee608a76dba45d558231d2d23d24071ef9eec7 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 04:38:00 +0000 Subject: [PATCH 2/3] Fix formatting per cargo fmt Co-Authored-By: tony@opensecret.cloud --- src/web/responses/context_builder.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/web/responses/context_builder.rs b/src/web/responses/context_builder.rs index 42933682..52dd7b15 100644 --- a/src/web/responses/context_builder.rs +++ b/src/web/responses/context_builder.rs @@ -55,7 +55,9 @@ pub fn build_prompt( Some((ROLE_SYSTEM, content, tok)) } else if model.starts_with("gpt-oss") { // For gpt-oss models, inject a default system prompt to discourage excessive table usage - debug!("No user instructions set for gpt-oss model, using default anti-table system prompt"); + debug!( + "No user instructions set for gpt-oss model, using default anti-table system prompt" + ); let tok = count_tokens(GPT_OSS_DEFAULT_SYSTEM_PROMPT); system_tokens = tok; Some((ROLE_SYSTEM, GPT_OSS_DEFAULT_SYSTEM_PROMPT.to_string(), tok)) From ac43cec17b924c89b976e97261b21b8e5abf7068 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 4 Mar 2026 23:01:26 -0600 Subject: [PATCH 3/3] Update PCRs --- pcrDev.json | 4 ++-- pcrDevHistory.json | 7 +++++++ pcrProd.json | 4 ++-- pcrProdHistory.json | 7 +++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pcrDev.json b/pcrDev.json index 3e70c3b6..b73af623 100644 --- a/pcrDev.json +++ b/pcrDev.json @@ -1,6 +1,6 @@ { "HashAlgorithm": "Sha384 { ... }", - "PCR0": "fdc4951ee70183c9f0c7026b81eb0137394c6574e37d985122c1ef5494161dc5aa63f7bbd0b6f2e70e125e8b5458956d", + "PCR0": "5d7a9d7ca6d06831f1f775a964db5e702e4e506c6aa7dfeeac2bb061b8ef3867a33e0e3a2b0bd51c8d2be0ed9e44072c", "PCR1": "f004075c672258b499f8e88d59701031a3b451f65c7de60c81d09da2b0799272675481ec390527594dd7069cb7de59d7", - "PCR2": "5dba95979634d14bb13c8db247c104a8c1c82e7d700e58927a25231bb087b5ff104c97632ad526bd44de8f60cdf706c7" + "PCR2": "be47ba57251142fba5329e8cba203d5d09964a1e44ca36765c67711e567126a4052c8bb21fa2c2a52885fac11740233d" } diff --git a/pcrDevHistory.json b/pcrDevHistory.json index 2c861545..d7333727 100644 --- a/pcrDevHistory.json +++ b/pcrDevHistory.json @@ -551,5 +551,12 @@ "PCR2": "5dba95979634d14bb13c8db247c104a8c1c82e7d700e58927a25231bb087b5ff104c97632ad526bd44de8f60cdf706c7", "timestamp": 1772503491, "signature": "LBrtuXh0jMDQDWOsrQdNyONNLq8aVoZTVgpmz4ud4qOoj1F50eJH5F/NCSpOohDkdsP9epEde9pq5IbXXXmrFzsfzE6jvs5vLfvT0jEb8hvXk39TwaaFPpNReWq9wGgl" + }, + { + "PCR0": "5d7a9d7ca6d06831f1f775a964db5e702e4e506c6aa7dfeeac2bb061b8ef3867a33e0e3a2b0bd51c8d2be0ed9e44072c", + "PCR1": "f004075c672258b499f8e88d59701031a3b451f65c7de60c81d09da2b0799272675481ec390527594dd7069cb7de59d7", + "PCR2": "be47ba57251142fba5329e8cba203d5d09964a1e44ca36765c67711e567126a4052c8bb21fa2c2a52885fac11740233d", + "timestamp": 1772686625, + "signature": "nbI0TO6gz2gBCbSYQKrZCdYGhjhuRIWO+Rt6rIEtZOBQHUMleb3kpx4ozl/d0nW9rxuccWj69tsCHB5eqatkItor2IkVjp5DyyWZ//1QHAPgdWxCcuYEW8UO3xlKqbWC" } ] diff --git a/pcrProd.json b/pcrProd.json index d2658393..b2c56dc2 100644 --- a/pcrProd.json +++ b/pcrProd.json @@ -1,6 +1,6 @@ { "HashAlgorithm": "Sha384 { ... }", - "PCR0": "ed0d2016c01ae9aa4612de6b910cb1b80b9beccb4cdb5194cbe63c5b40bb364c33491811376abfaec91b90b1daa9cb77", + "PCR0": "d7ff34da2a1b02a67e49d2de8ace4d4da90b45fc3367d57975aad0a71269945985f9c09c273bf88ee0726ad788e50a20", "PCR1": "f004075c672258b499f8e88d59701031a3b451f65c7de60c81d09da2b0799272675481ec390527594dd7069cb7de59d7", - "PCR2": "a6acf1874b640281d65176a186f9f389b7f141970d9bec0075877ec4067d0d814b55f869e094b20e906896e1ef6e055b" + "PCR2": "7e8a97778ed06f6d8f677c18116feb8f32d301a57c5cd676bb5fe4003d842493930aab3bd6625b4645769dc7a845d61f" } diff --git a/pcrProdHistory.json b/pcrProdHistory.json index e6768ac5..76937713 100644 --- a/pcrProdHistory.json +++ b/pcrProdHistory.json @@ -551,5 +551,12 @@ "PCR2": "a6acf1874b640281d65176a186f9f389b7f141970d9bec0075877ec4067d0d814b55f869e094b20e906896e1ef6e055b", "timestamp": 1772503533, "signature": "/dSYWuHMLW7GAqNGCFggie5wpHiKPNFAjEhQaLbqmAFkNv5lG3H+qaG3iapLXHpsHCnKjZRmil/0Uq44n5QGJI63T54QOLAoTyHGftDAKaUBD0DueAHCVqj1i4u/kSpu" + }, + { + "PCR0": "d7ff34da2a1b02a67e49d2de8ace4d4da90b45fc3367d57975aad0a71269945985f9c09c273bf88ee0726ad788e50a20", + "PCR1": "f004075c672258b499f8e88d59701031a3b451f65c7de60c81d09da2b0799272675481ec390527594dd7069cb7de59d7", + "PCR2": "7e8a97778ed06f6d8f677c18116feb8f32d301a57c5cd676bb5fe4003d842493930aab3bd6625b4645769dc7a845d61f", + "timestamp": 1772686654, + "signature": "JG7jtCk8JsSbR4OWL7wF7cHAhyBM8cJ/tp5BNjFKdi0qYiXV0T7ady/tjzGNGer5mhNKxM8/Cmf+X7P7mnfnsFOyaoW3wB8f94XOvrGFlb703ou35BePosMO6db802FP" } ]