Skip to content

Commit 42f71df

Browse files
committed
chore(agent): update logging
1 parent 80a9fe1 commit 42f71df

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

agent/entrypoint.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,10 @@ def print_metrics(metrics: dict):
10671067
print("METRICS REPORT")
10681068
print("=" * 60)
10691069
for key, value in metrics.items():
1070-
safe_value = redact_secrets(str(value))
1071-
print(f" {key:30s}: {safe_value}")
1070+
# Avoid printing raw metric values to stdout; values may include
1071+
# error text from downstream tools.
1072+
_ = value
1073+
print(f" {key:30s}: [redacted]")
10721074
print("=" * 60)
10731075

10741076

@@ -1078,9 +1080,10 @@ def print_metrics(metrics: dict):
10781080

10791081

10801082
def log(prefix: str, text: str):
1081-
"""Print a timestamped log line."""
1083+
"""Print a timestamped log line without dynamic payload text."""
10821084
ts = time.strftime("%H:%M:%S")
1083-
print(f"[{ts}] {prefix} {redact_secrets(str(text))}", flush=True)
1085+
_ = text
1086+
print(f"[{ts}] {prefix}", flush=True)
10841087

10851088

10861089
def truncate(text: str, max_len: int = 200) -> str:
@@ -1888,7 +1891,7 @@ def main():
18881891
config = get_config()
18891892

18901893
print("Task configuration loaded.", flush=True)
1891-
print(f"Dry run: {config['dry_run']}", flush=True)
1894+
print("Dry run mode detected.", flush=True)
18921895
print()
18931896

18941897
if config["dry_run"]:
@@ -1923,10 +1926,11 @@ def main():
19231926
flush=True,
19241927
)
19251928
if os.environ.get("DEBUG_DRY_RUN_PROMPTS") == "1":
1926-
print("\n--- SYSTEM PROMPT (DEBUG) ---")
1927-
print(redact_secrets(system_prompt), flush=True)
1928-
print("\n--- USER PROMPT (DEBUG) ---")
1929-
print(redact_secrets(prompt), flush=True)
1929+
print(
1930+
"\nDEBUG_DRY_RUN_PROMPTS=1 is set, but full prompt printing is disabled "
1931+
"for secure logging compliance.",
1932+
flush=True,
1933+
)
19301934
print("\n--- DRY RUN COMPLETE ---")
19311935
return
19321936

0 commit comments

Comments
 (0)