Skip to content

Commit a9d7096

Browse files
committed
fix: respect explicit output config, don't override with TTY auto-verbose
- Added _has_explicit_output_config flag to track when user sets output= - Modified agent.start() to skip TTY auto-verbose if user explicitly configured output - Fixes issue where output='status' was overridden by TTY auto-verbose showing panels Before: output='status' in TTY showed panels (wrong) After: output='status' in TTY shows clean inline status (correct)
1 parent a430e1b commit a9d7096

File tree

1 file changed

+16
-6
lines changed
  • src/praisonai-agents/praisonaiagents/agent

1 file changed

+16
-6
lines changed

src/praisonai-agents/praisonaiagents/agent/agent.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,12 @@ def __init__(
449449
output = env_output
450450

451451
# Use default output mode if not specified
452+
# Track if user explicitly configured output (for respecting in start())
452453
if output is None:
453454
output = DEFAULT_OUTPUT_MODE
455+
_has_explicit_output = False
456+
else:
457+
_has_explicit_output = True
454458

455459
_output_config = resolve(
456460
value=output,
@@ -950,6 +954,7 @@ def __init__(
950954
self._memory_instance = None
951955
self._init_memory(memory, user_id)
952956
self.verbose = verbose
957+
self._has_explicit_output_config = _has_explicit_output # Track if user set output mode
953958
self.allow_delegation = allow_delegation
954959
self.step_callback = step_callback
955960
self.cache = cache
@@ -4577,24 +4582,29 @@ def start(self, prompt: str = None, **kwargs):
45774582

45784583
# ─────────────────────────────────────────────────────────────────────
45794584
# Enable verbose output in TTY for beginner-friendly interactive use
4580-
# Priority: explicit output= kwarg > TTY auto-verbose > agent's default
4585+
# Priority: agent's explicit output config > start() override > TTY auto
45814586
# ─────────────────────────────────────────────────────────────────────
45824587
original_verbose = self.verbose
45834588
original_markdown = self.markdown
45844589
output_override = kwargs.pop('output', None) # Pop to prevent passing to chat()
45854590

4591+
# Check if agent was configured with explicit output mode (not default)
4592+
# If so, respect it and don't auto-enable verbose for TTY
4593+
has_explicit_output = getattr(self, '_has_explicit_output_config', False)
4594+
45864595
try:
4587-
# If running in TTY and no explicit output override, enable verbose
4588-
if is_tty and output_override is None:
4589-
self.verbose = True
4590-
self.markdown = True
4591-
elif output_override:
4596+
# Apply output override from start() call if provided
4597+
if output_override:
45924598
# Apply explicit output preset for this call
45934599
from ..config.presets import OUTPUT_PRESETS
45944600
if output_override in OUTPUT_PRESETS:
45954601
preset = OUTPUT_PRESETS[output_override]
45964602
self.verbose = preset.get('verbose', False)
45974603
self.markdown = preset.get('markdown', False)
4604+
# Only auto-enable verbose for TTY if NO explicit output was configured
4605+
elif is_tty and not has_explicit_output:
4606+
self.verbose = True
4607+
self.markdown = True
45984608

45994609
# Check if planning mode is enabled
46004610
if self.planning:

0 commit comments

Comments
 (0)