Spaces:
Configuration error
Configuration error
Fix double stdin read bug in prompt_submit.py hook
Browse files6 unmodified lines789101112131415161718192021222324256 unmodified linesfrom hook_utils import resolve_project, is_sdk_child, api_call_bgdef main():# Log to file for debugginglog_path = os.path.expanduser("~/.agentmemory/hook_log.txt")try:with open(log_path, "a", encoding="utf-8") as f:f.write(f"[{datetime.now(timezone.utc).isoformat()}] prompt_submit hook called\n")f.write(f"stdin content: {sys.stdin.read()[:500]}\n")except Exception as e:pass# Reset stdin for actual processingsys.stdin = open(sys.stdin.fileno(), 'r')try:input_data = sys.stdin.read()if not input_data:returndata = json.loads(input_data)6 unmodified lines7891011121314151617181920212223242526276 unmodified linesfrom hook_utils import resolve_project, is_sdk_child, api_call_bgdef main():try:input_data = sys.stdin.read()except Exception:return# Log to file for debugginglog_path = os.path.expanduser("~/.agentmemory/hook_log.txt")try:with open(log_path, "a", encoding="utf-8") as f:f.write(f"[{datetime.now(timezone.utc).isoformat()}] prompt_submit hook called\n")f.write(f"stdin content: {input_data[:500]}\n")except Exception as e:passtry:if not input_data:returndata = json.loads(input_data)
plugin/scripts/prompt_submit.py+6-4